cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the EEPROM emulation example code "EEPROM_Emul" from"X-CUBE-EEPROM_V2.0.0" package on a custom STM32WB55CE board.

GBehe
Associate III

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.

30 REPLIES 30
Remi QUINTIN
ST Employee

​Using CubeProgrammer, the mass erase is achieved checking the "Select" option to select all sectors.

Then click on "Erase selected sectors". It must work!

Remi QUINTIN
ST Employee
 
GBehe
Associate III

Ok. Thanks for that info.

So, why the BLE communication is working now and EEPROM Emulation is not?

And is still the FLASH Mass erase is necessary?

GBehe
Associate III

Ok. Thank you for that info.

So after using those commands you shared, why the BLE communication has started working now and EEPROM Emulation still not?

And now as I have tested the "BLE heart rate example code", is communicating with my mobile, do I need to do a FLASH Mass erase ?

Remi QUINTIN
ST Employee

>is the FLASH Mass erase still necessary?

No. It should not be necessary but it is a kind of sanity check as the FUS is looking for some specific key code in flash memory to udentify the start of the new FW to upgrade, It is more secure to clean the user area​ (up to SFSA).

>So, why the BLE communication is working now and EEPROM Emulation is not?

The X-CUBE-EEPROM package supports many families like L4, G4 and WB but as it is a single piece of code, there are possible some #ifdef dedicated to WB that may have been forgotten. I will check with the guy who developed this package.

Adam Santamaria
Associate II

Hello,

I took part to the development of the application.

I have several questions.

Firstly when you say the heart rate example is working, do you mean you have launched the BLE_HeartRate_EEPROM_Emul project but only the BLE HeartRate task is working and the EEPROM emulation is trapped ? Or you are refering to the HeartRate only example ?

Secondly, by default the emulated EEPROM start at the flash address 0x08080000 (see START_PAGE_ADDRESS constant in eeprom_emul_conf.h.).

If you check STM32Cube_FW_WB_V1.8.0/Projects/STM32WB_Copro_Wireless_Binaries/STM32WB5x/Release_Notes.html, you will see the addresses where are loaded the FUS and BLE stacks binaries. 

Can you please check that for your product, the FUS or stack is not on the same flash area than the EEPROM emulation ? For example, for the 512k WB5xxE(512K), the FUS is at 0x0807A000 which is near from the emulated EEPROM (5 pages difference).

If this is the issue, a solution would be to modify the START_PAGE_ADDRESS constant in eeprom_emul_conf.h.

Tell me if it help you and if it is the case i will precise this point in the associated Application Note.

Thanks. Waiting for your feedback,

Adam S.

GBehe
Associate III

Hi Adam.

I am referring to the Heart Rate example code in BLE Package, which only sends random Heartrate data.

STM32Cube_FW_WB_V1.7.0\Projects\P-NUCLEO-WB55.USBDongle\Applications\BLE\BLE_HeartRate

I am not referring to BLE_HeartRate_EEPROM_Emul from EEPROM Emul package.

In My device also the FUS Binary address is 0x0807A000 and BLE stack address is 0x08057000.

So, I changed the START_PAGE_ADDRESS in eeprom_emul_conf.h to 0x080F0000.

I did debug and it is going to the same "HARD FAULT HANDLER" , when I come across the below point.

"eeprom_emul.c" -> in "EE_Status EE_Init()" -> addressvalue = (*(__IO EE_ELEMENT_TYPE*)(pageaddress + varidx)); //(Line number 255)

I again changed the START_PAGE_ADDRESS to 0x080FA000. And I got the same result.

Thank you.

Adam Santamaria
Associate II

Hi GBehe,

I am still investigating.

Do you have the same problem when you run the X-CUBE-EEPROM_V2.0.0\Projects\STM32WB\EEPROM_Emul application (no BLE) ? Do you confirm you succeed to run the heartrate+eeprom application on your WB Nucleo ?

Thanks

Adam

Adam Santamaria
Associate II

Hi again,

I have another potential cause for your problem.

Still in the file STM32Cube_FW_WB_V1.8.0/Projects/STM32WB_Copro_Wireless_Binaries/STM32WB5x/Release_Notes.html,

It is said that:

So can you check the SFSA value for your product ? It should be 0x57 (BLE stack starting address). Then you can't set an emulated EEPROM after the address 0x08057000 because this area can't be used by the user application anymore (only CPU2 can change SFSA, user cannot).

Thanks.

Adam

Adam Santamaria
Associate II

Seems the screenshot did not pass...

To complete:

...It is said that:

0693W000003PysZQAS.png