Hardware and Software Co-Design
Activity Report
Michele Faccone
MATR. 196001
A.A. 2024/25
Introduction
This report describes the activity related to Hardware and Software Co-Design examination.
The project given revolved around the concepts of PCB design, neural network deployment and
firmware development, and in the following each of these aspects will be discussed in detail.
As requested, the project must take into account the development of a PCB design comprehensive
of STM32F401 integrated circuit, a battery manager, a UART interface or USB module and finally
a TDK InvenSense accelerometer, as close as possible in performance to the ST LIS3DH used in
frontal lessons.
Furthermore, on Google Colab, the request was to develop a notebook able to define a neural
network model, to train it through the use of given accelerometer data properly handled and
segmented in classes and to visualize its performance. Also, in order to test it on an external board
(STM32F401RE), the ONNX model extraction process must be set up.
Eventually, the requirements accounted to develop a STM32CUBEIDE project able to include the
ONNX model extracted and classifies data from an .h file, included in the project, that collects data
from at least 3 classes. Every second, then, the neural network must print the prediction value on the
screen.
PCB design: schematic
PCB is a crucial step in the development of the project, due to the fact that some practical and
functional choices must be made in order to reduce board dimensions and reduce the amount of vias
on the board. This implies that the arrangement of components requires the activation of some
communication protocols over the devices more than other ones. In the following, when discussing
about the connection between the MCU and the accelerometer, this point will be further explained.
Also, in round brackets, it’s possible to find the schematic references of each component discussed.
Starting from the supply, in Figure 1 it’s possible to look at the schematic reference.
Figure 1: Power Supply schematic.
The board is supplied through a 4.2V LiPo battery, connected through a male connector (J1), which
is charged through the LTC4056 integrated circuit (U1), that shows the charging state through a
green LED and decouples the load from the battery when the charger is connected and is charging
the battery. When the charge is completed, the LED turns off, but until the charger is connected the
load is decoupled. The decoupling is performed through the use of a P-MOSFET device (Q2),
driven on the gate by the 5V supply. When turned off, the gate is driven to ground through a pull-
down resistor (R1) that allows to discharge all the parasitic gate capacitances, and so to switch
properly the device.
After the battery charger, the battery voltage is given as input of the TPS73533DRVT regulator
(U2), which generates a fixed-3.3 DC voltage that supplies all the logic side of the circuit, except
for the CP2102-GM (U4A) bridge that is supplied by the micro-USB connector.
Continuing the discussion, the PCB developed implements, as shown in Figure 2,
STM32F401RET6 as Main Control Unit (U3), which is interfaced with external peripherals through
CP2102-GM UART to USB bridge (U4A) and a micro-USB connector, shown in Figure 3. As input
device, a TDK InvenSense IIM-42352 (U5) has been configured in order to communicate through
SPI protocol. Figure 2: ST MCU, TDK InvenSense accelerometer, debug strip.
Also, two interrupt pins are connected to enable interrupt features as possible further evolution.
Debug strip (P2) is implemented to allow interfacing with an external debugger which requires
SWDIO and SWCLK connections in order to perform correctly. Then, RESET, 3.3V and GND are
present to enable MCU hardware reset and voltage reference for the debugger, respectively. Please
note that the connection of the interrupts and SPI pins of the accelerometer has been chosen in order
to have an easier placement over the board. As it’s possible to note on the PCB design (Figure 4),
these choices allowed an easy and close placement of the accelerometer with respect to the MCU.
The interfacing with external USB devices happens through CP2102-GM bridge (U4A), which
al
-
Appunti di Hardware & Software Technologies for Design
-
Prova d'esame svolta febbraio 2021 di Numerical methods
-
Prova svolta d'esame di Economia aziendale
-
Prova svolta Chimica generale e inorganica