Zubax / gridsens_gs2

Zubax GNSS module
https://zubax.com/products/gnss_2
GNU General Public License v3.0
51 stars 57 forks source link

the application descriptor "APDesc00" how did it create in bin? #19

Closed liganggg closed 4 years ago

liganggg commented 4 years ago

question 1 by the source code i see "APDesc00' set by linker script" but in the ld.ld only define the address by "PROVIDE(DeviceSignatureStorage = ORIGIN(flash) - 256);" i cant find the define of "APDes00"

question 2 after build the firmware , check bin file , why the address of "APDesc00" is not equal ORIGIN(flash) - 256) ? thanks

pavel-kirienko commented 4 years ago

i cant find the define of "APDes00"

Here:

https://github.com/Zubax/zubax_gnss/blob/2e8a012fdf55d5f4cd1e47f97acaadb7adda8df4/firmware/src/bootloader_interface/bootloader_interface.cpp#L32

The Image CRC is computed and populated in the compiled binary by this script: https://github.com/Zubax/zubax_chibios/blob/54b9375447b3d6050e59386f57f47ed2c1af273f/tools/make_boot_descriptor.py. Find the usage in the Makefile.

after build the firmware , check bin file , why the address of "APDesc00" is not equal ORIGIN(flash) - 256) ?

It's not supposed to be. APDes00 can be located anywhere, really. The address you are referring to is for the Certificate of Authenticity; it is written by an external tool after the device is manufactured, not at the build time.