cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC™ 6

PaSw_2578827
New Contributor II

I'm using PSoC Creator to program a PSoC6 BLE Module dev kit (Cy8CPROTO-0630BLE). Part of my application involves writing a setting via a writeable characteristic which is then used to generate internal settings to be stored in NVM. BLE is configured in Dual Core mode and my application is running on the M4, the M0+ is not doing anything other than BLE stuff.

I've tried using emEeprom API and Cy_BLE_StoreAppData() but both appear to have the same issue, causing the program to enter the FaultHandler. In both cases the fault appears to happen when setting the IPC flag, callstack:

 

Cy_SysLib_ProcessingFault() Generated_Source\PSoC6\pdl\drivers\peripheral\syslib\cy_syslib.c 472 0x10085900 (All)
Cy_SysLib_FaultHandler(const uint32_t * faultStackAddr = 0x80474d0) Generated_Source\PSoC6\pdl\drivers\peripheral\syslib\cy_syslib.c 444 0x100858EC (All)
UsageFault_Handler() gcc/startup_psoc6_01_cm4.S 455 0x1008036A (All)
<signal handler called>() ?????? ?????? 0xFFFFFFF9 (All)
Cy_IPC_Sema_Clear(uint32_t semaNumber = 4294967289, _Bool preemptable = 16) Generated_Source\PSoC6\pdl\drivers\peripheral\ipc\cy_ipc_sema.c 307 0x10082C4C (All)
Cy_Flash_SendCmd(uint32_t mode = 0, uint32_t microseconds = 2580) Generated_Source\PSoC6\pdl\drivers\peripheral\flash\cy_flash.c 443 0x08024D88 (All)
Cy_Flash_StartErase(uint32_t rowAddr = 269005312) Generated_Source\PSoC6\pdl\drivers\peripheral\flash\cy_flash.c 915 0x10082546 (All)
Cy_Flash_StartWrite(uint32_t rowAddr = 269005312, const uint32_t * data = 0x80475a4) Generated_Source\PSoC6\pdl\drivers\peripheral\flash\cy_flash.c 829 0x1008246A (All)
WriteRow(uint32_t rowAddr = 269005312, uint32_t * rowData = 0x80475a4, cy_stc_eeprom_context_t * context = 0x8028650 <ANIM_EEPROM_context>) Generated_Source\PSoC6\pdl\middleware\em_eeprom\cy_em_eeprom.c 985 0x1008A900 (All)
Cy_Em_EEPROM_Write(uint32_t addr = 0, void * eepromData = 0x8027c54, uint32_t size = 160, cy_stc_eeprom_context_t * context = 0x8028650 <ANIM_EEPROM_context>) Generated_Source\PSoC6\pdl\middleware\em_eeprom\cy_em_eeprom.c 549 0x1008A5DC (All)
nvm_update() haptics.c 221 0x10081424 (All)
HostMain() host_main.c 456 0x10081B56 (All)
main() main_cm4.c 73 0x10080386 (All)

 

 

I've found some similar issues by searching the forums but nothing that appeared to be the exact same, mostly it was a DeepSleep issue or possibly a clock change issue when writing flash? I tried the native Cy_BLE_StoreAppData() API function too, hoping that would play better with the BLE Stack but I had the exact same issue. I did try (unsuccessfully) to protect the flash write using:

 

if(cy_ble_pendingFlashWrite != 0u)  return;

<Flash Write>

return

 

and

 

while (CY_IPC_SEMA_SUCCESS != Cy_IPC_Sema_Set(CY_BLE_SEMA, false)){}

<Flash Write>

while (CY_IPC_SEMA_SUCCESS != Cy_IPC_Sema_Clear(CY_BLE_SEMA, false)){}

 

 

0 Likes
4 Replies
Yugandhar
Moderator
Moderator

Hello, 

Could you please share your complete project ?

Thanks,

P Yugandhar.

0 Likes
PaSw_2578827
New Contributor II

I've attached a stripped down version of the project that exhibits the same behavior. I'm using PSoC Creator 4.4 (4.4.0.80) and Peripheral Driver Library 3.1.3

0 Likes
PaSw_2578827
New Contributor II

@Yugandhar Any update to this, were you able to replicate using the project that I sent to you?

0 Likes
Yugandhar
Moderator
Moderator

Hello, 

Sorry for the delay in response. I had tried programming your project. After BLE connection, i tried writing values to the BLE Peripheral device. I didn't observed any issues. Could you please let me know the steps to replicate the issue ? 

Please try running a test project to confirm if flash writes works in an empty project without BLE. Once that is confirmed you could try Enabling the BLE in your application and try writing to Flash.

Please use the latest BLE PDL v3.1.5 and BLE component v2.20 in the project.

Thanks,

P Yugandhar. 

0 Likes
Top labels