How to use the EEPROM emulation example code "EEPROM_Emul" from"X-CUBE-EEPROM_V2.0.0" package on a custom STM32WB55CE board.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-19 06:14 AM
I have my custom STM32WB55CE board. I had programmed the example code "EEPROM_Emul" from"X-CUBE-EEPROM_V2.0.0" package on it. It was working fine. Then I did FUS upgrade with BLE full stack binary programming on it. After that, the same EEPROM emulation example code gets stuck at EE_Init() function. It goes into Hardfault handler. I did a FLASH erase and reprogrammed the example code. On my STM32WB55 Neucleo board, it works fine. Please guide on this.
Thank you.
- Labels:
-
EEPROM devices
-
STM32WB series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-19 06:56 AM
​>I did a FLASH erase and reprogrammed the example code
Did rework?
EE_Init() => may be blocked when trying to perform the first flash accesses.
Which WB FW package version are you using?
You upgrade the RF stack, not the FUS.. correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-19 07:20 AM
Hi Remi.
Thanks for such a quick response.
Sorry, I did not get "Did rework?" - I just did Flash erase operation - all sectors (in STLink Utility) and again programmed the EEPROM emulation example code.
I am not aware about blocking during first flash accesses .
Regarding FUS, first time I did upgrade with FUS fs 1.0.2 after performing a Firmware Delete operation(In STM32Cube Programmer(GUI)). And programmed BLE_Stack_full_fw.bin and it was successful. When I did these same procedures again, it failed. I also tried with STM32Cube Programmer(CLI). It still failed. Even BLE stack programming failed. Apart from these two binaries upgrade, I did not do anything else.
I always tried to program BLE full fw stack.
Next , I tried EEPROM emulation example code again.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-19 08:02 AM
Sorry => Did it rework? I was asking whether the example code was running OK again.
>When I did these same procedures again, it failed => This is expected. The FUS never accepts the reprograming of the same version as the one already installed. Only new upgraded version can be programed. There is an anti-rollback mechanism that prevents any old (or same) FUS version to be reinstalled.
When I got issues like yours, I always perform a mass erase of the flash memory in order to start from a clean state.
This can be done via the 2 lines in a batch file in CLI mode
CLI.exe -c port=swd -ob RDP=0xBB
CLI.exe -c port=swd -rdu
Or using the mass erase feature available in the CubeProgrammer tool in GUI mode.
Then the upload of the RF stack should be OK.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-19 10:33 AM
Got it. But is't it strange that the BLE stack also is not getting programmed?
And, is there anything from FUS upgrade side effecting EEPROM Emulation not working as I am facing now?
I am asking it, because on my board. the example was working, I did debug it two times. After the FUS and BLE binary upgrades I found my issue.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-19 11:26 PM
To do a mass erase, I tried first using CUBE programmer GUI. It doesn't provide the option when my device is connected. You an see the screenshot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-19 11:27 PM
Then I tried doing it in STlink utility. It also ailed. Screenshot attached.
Log:
10:57:45 : ST-LINK SN : 066EFF545150656767240731
10:57:45 : ST-LINK Firmware version : V2J36M26
10:57:45 : Connected via SWD.
10:57:45 : SWD Frequency = 4,0 MHz.
10:57:45 : Connection mode : Connect Under Reset.
10:57:45 : Debug in Low Power mode enabled.
10:57:45 : Device ID:0x495
10:57:45 : Device flash Size : 1MBytes
10:57:45 : Device family :STM32WBxx
10:59:28 : [SAFIN_peripherals_test_latest.bin] opened successfully.
10:59:28 : [SAFIN_peripherals_test_latest.bin] checksum : 0x00605EF4
11:05:19 : Error occured during flash mass erase!
11:19:39 : Disconnected from device.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-19 11:29 PM
If I do sector erase, It works but does not show any success message. The log is below.
11:29:25 : ST-LINK SN : 066EFF545150656767240731
11:29:25 : ST-LINK Firmware version : V2J36M26
11:29:25 : Connected via SWD.
11:29:25 : SWD Frequency = 4,0 MHz.
11:29:25 : Connection mode : Connect Under Reset.
11:29:25 : Debug in Low Power mode enabled.
11:29:25 : Device ID:0x495
11:29:25 : Device flash Size : 1MBytes
11:29:25 : Device family :STM32WBxx
11:31:40 : ST-LINK SN : 066EFF545150656767240731
11:31:40 : ST-LINK Firmware version : V2J36M26
11:31:40 : Connected via SWD.
11:31:40 : SWD Frequency = 4,0 MHz.
11:31:40 : Connection mode : Connect Under Reset.
11:31:40 : Debug in Low Power mode enabled.
11:31:40 : Device ID:0x495
11:31:40 : Device flash Size : 1MBytes
11:31:40 : Device family :STM32WBxx
Does it mean Flash erase was successful?
Again, I performed those commands you had mentioned, in Cube programmer CLI. They worked fine. You can see in the screenshot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-19 11:34 PM
The command for memory read protection disabling also worked.
But after this, I did not perform the FUS upgrade and Radio stack binaries programming. And I did EEPROM emulation example programming, thinking that lets do it freshly. It's still going to Hard Fault handler in the EE_Init() function.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-08-20 12:14 AM
After this, I did not do any FUS and Radio stack updates. And BLE Heart rate example project is working. I am able to connect from my Mobile and access data.
Strange.