You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- add definition of memory functions and log function
47
-
- remove define **TEST_PATCH**
48
-
49
40
## bpatch structure
50
41
Are present two instructions: **CPY** to copy bytes from the old firmware, **ADD** to add new bytes. To save the bit to indicate the command in final patch it is assumed that the first instruction is a **CPY** then there is an alternance between **ADD** and **CPY**
51
42
@@ -162,6 +153,8 @@ In *bpatch.c*
162
153
163
154
- define *write_header*: function to re-built header for correspondent bytes from the patch
164
155
156
+
In the repository is present as example a custum header for SBSFU expansion for STM32, detailed [here](https://www.st.com/en/embedded-software/x-cube-sbsfu.html)
157
+
165
158
166
159
## CSV report format
167
160
@@ -175,4 +168,9 @@ Fields of CSV report:
175
168
-**OVER_NBD**: number of bit necessary to NBD field compared to the total number new bytes in percentage
176
169
-**OVER_NBC**: number of bit necessary to NBC field compared to the total number new bytes in percentage
177
170
-**OVER_NBA**: number of bit necessary to NBA field compared to the total number new bytes in percentage
178
-
-**OVER_TOT**: number of bit necessary to NBD, NBC, NBA fields compared to the total number new bytes in percentage
171
+
-**OVER_TOT**: number of bit necessary to NBD, NBC, NBA fields compared to the total number new bytes in percentage
172
+
173
+
174
+
## Test environment
175
+
176
+
It is present a **test** folder when the application can be tested and assessed on firmwares
C source code to apply the patch and reconstruct the new firmware. The application read and write from generic flash memory, it is possible to define the read/write functions.
2
+
To test the code it is created a wrapper where the memory region is mapped on the stack, firmwares and patch are passed as files. To enable the wrapper you have to
- add definition of memory functions and log function
15
+
- add memory address of old firmware slot, new firmware slot and pacth slot
16
+
- remove define **TEST_PATCH**
17
+
- use with:
18
+
19
+
bpatch();
20
+
21
+
## Custom header
22
+
23
+
In *header_sbsfu.c* and *header_sbsfu.h* are present an example of custom header function and defines based on SBSFU expansion packet for STM32 detailed [here](https://www.st.com/en/embedded-software/x-cube-sbsfu.html)
0 commit comments