NabuCasa / silabs-firmware-builder

Silicon Labs firmware builder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[REQUEST] Add device branding using userdata token with manufacturer and board name via a tokenfile?

Hedda opened this issue · comments

commented

Maybe consider adding userdata token with manufacturer and board name via a tokenfile as unique device branding?

That is, add; manufacturer string, unique board name string (e.g. hardware model and revision), and unique manufacturer ID.

@MattWestb has posted instructions here -> https://github.com/MattWestb/EFR32-FW/blob/main/Branding_EFR32/README.md

Copy of his readme below:

All EFR32 chips have one dictated aria in the flash for user data named userdata.

It stores some manufacturer tokens and also custom tokens.

It is not being erased of debug unlock / flash erase and firmware flashing. Chip ease and writing "erase" as token data is deleting it or writing it newly updated token.

IKEA is using it to store custom tokens by overriding the model ID and other parameters that are in the firmware for using the same firmware for more products like the 5 button remotes have the same firmware but different names.

For NCP firmware you can store some of the tokens and bellows / ZHA is reading them and you are getting in the log.

You can write tokens one by one or more from one file.

You can write them to the chip (flashing the chip with new tokens) or append them to one firmware that is flashing the firmware and the new tokens.

Example of token file:

MFG_STRING                    : "IKEA of Sweden"
MFG_BOARD_NAME                : "Billy EZSP by MW"
MFG_MANUF_ID                  : 0x110C

And flashing the token file with simplicity commander:

.\commander.exe flash --tokengroup znet --tokenfile .\tokens-MW.txt -d EFR32MG1P132F256IM32
WARNING: The string for token MFG_BOARD_NAME (Billy EZSP by MW) fills all 16 bytes of the token space. The string will not be zero terminated.
Writing 2048 bytes starting at address 0x0fe00000
Comparing range 0x0FE00000 - 0x0FE007FF (2 KB)
Erasing range 0x0FE00000 - 0x0FE007FF (1 sector, 2 KB)
Programming range 0x0FE00000 - 0x0FE001FF (512 Bytes)
Programming range 0x0FE00200 - 0x0FE003FF (512 Bytes)
DONE

You are getting this from the bellow info:

Manufacturer: IKEA of Sweden
Board name: Billy EZSP by MW
EmberZNet version: 6.9.0.0 build 178

The same should work with this command for appending the token to one firmware file:

$ commander convert blink.s37 --tokengroup znet --tokenfile tokens.txt --device EFR32MG1P --outfile blink.hex Converts blink.s37 to hex format, while simultaneously defining the tokens defined in tokens.txt and on the command line.

Only putting your parameters for your chip and the in and output file.

Editing: It looks it is only possible to use the "flash" or "convert" s37 to s37 fils and add the tokens but to GBL is not working and if having one s37 file with tokens and converting/creating one GBL it is only taking the app and not the extra data for the tokens.

I think that is made for not being possible "streeling" devices without having hw access to them (= SWD flashing).

Also if you are having one IKEA device hooked up you should dump the user area that can be used for "transforming" one device if you like.

The main firmware can be restored from one OTA file but not the user data so all dumps of its is very welcome in the community for firmware transforming.

SC that is shipped is already branded with manufacture token in user data.

Manufacturer: Nabu Casa
Board name: SkyConnect v1.0
EmberZNet version: 7.0.2.0 build 406
commented

SC that is shipped is already branded with manufacture token in user data.

So should writing of that userdata token be separate from this https://github.com/NabuCasa/silabs-firmware-builder project or?

If so would this request be better suited for the https://github.com/NabuCasa/universal-silabs-flasher project instead?

The token cant being flashed with GBL file (at least documented by SL) its flashed in the manufacturing processes and cant being updated after it left the factory so its out of topic.

= have nothing to do with the firmware building and flashing GBL files from the bootloader.

The token cant being flashed with GBL file (at least documented by SL)

It can be flashed through the SE manager API, and there is an example application in the Gecko SDK, see se_manager_user_data (specifically app_process.c).

its flashed in the manufacturing processes and cant being updated after it left the factory so its out of topic.

= have nothing to do with the firmware building and flashing GBL files from the bootloader.

Yes agreed, token flashing is out-of-topic for this repository. There are more Manufacturing issues than token flashing, and our goal is not to create a set of tools to ease manufacturing. SiLab already provides much of that.

I think one good download for getting most interesting docks for Silabs Zigbee and thread products is: https://github.com/SiliconLabs/gecko_sdk/releases/download/v4.2.2/documentation.zip and its take little time reading and little longer for understanding (if can do it).
So pleas @Hedda go and getting ti !!