cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC™ 4

ErGo_3681856
New Contributor

I am using CY8C4248LQI-BL483. I have a bootable stack and application. I am bonding to the device. I'm using em_EEPROM V2.2

When I write to a secure BLE characteristic from my phone and then some time later in the main context call Em_EEPROM_1_Erase(), when the firmware next reaches CyBle_ProcessEvents(); it all hangs. I don't receive any error messages from CyBle_ProcessEvents(); nor from Em_EEPROM_1_Erase();

I can increase the amount of time after writing a secure BLE characteristic before calling Em_EEPROM_1_Erase() and the code will still hang when it reaches CyBle_ProcessEvents();

I can write and read and erase from the EEPROM as long as I do not write to a characteristic.

Is there a known bad interaction with Bonding or BLE and the Emulated EEPROM? Is there a workaround for this?

This does not appear related to KBA228069 as the device does not need to be powered down for this interaction to occur.

0 Likes
1 Solution
GeonaP_26
Moderator
Moderator

Emulated EEPROM stores data in device flash. Flash operations are row wise and single flash row erase can take as much as 13 ms (refer to Flash AC Specifications in device datasheet for more details). Continuous flash operations during the BLE connected state may result in processing of BLE events to be pending and can cause disconnection. Also, the device should not be reset during flash operations. Please ensure that there is no fluctuations in the power supply and implement following steps;

  • Place Emulated EEPROM data storage in checksum exclude memory region const uint8_t Em_EEPROM_1_em_EepromStorage[Em_EEPROM_1_PHYSICAL_SIZE] __ALIGNED(CY_FLASH_SIZEOF_ROW)  CY_SECTION(".cy_checksum_exclude") = {0u};
  • Try calling the Em_EEPROM / flash operations only if the BLESS state is CYBLE_BLESS_STATE_EVENT_CLOSE
  • Call Em_EEPROM / flash operations when cyBle_pendingFlashWrite variable is zero.

View solution in original post

0 Likes
3 Replies