Issue with 'scan complete' in application with critical sections

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DaCi_2122796
Level 3
Level 3

I'm having an issue where I never get a scan complete event in my application containing critical sections (aka, scheduler and interrupts disabled). If I try running the example scan snippet, I see that a scan complete event occurs; however, in my application it does not. I have determined that this error occurs due to never receiving scan complete event from the 43362 chipset. I determined this by inspecting the status of every ASYNCEVENT_HEADER message in the event handler loop of 'wiced_process_sdpcm' in 'SDPCM.c' and logging any messages containing the correct status value.

Now, I'm running WICED 2.3.1, not 2.4.x. I understand that 2.4.x resolves some issue with SDIO Bus reliability. Is this the issue I'm seeing? Or is there something else that can trigger what I'm encountering?

-Dan

0 Likes
1 Solution

Scratch all that. It appears to be a memory corruption issue with the section of code. I'll address this later, but for now I'm leaving it out.

View solution in original post

0 Likes
3 Replies
DaCi_2122796
Level 3
Level 3

I have ported the application over to 2.4.1 and am still seeing the same issue. wiced_wifi_scan_networks still does not receive a scan complete message. It does not arrive on the SDIO bus.

0 Likes

Further information: I have (maybe) resolved the issue. That said I want a serious explanation as to why this "solves" the issue.

So, Early In The World, my application mallocs some tables; nothing too huge, the equivalent calls are as follows:

malloc(103)

malloc(103);

malloc(45);

malloc(36);

malloc(140);

malloc(21);

malloc(44);

malloc(6);

malloc(22);

malloc(12);

malloc(24);

Currently, I don't use/need these tables, so I can get rid of these calls and everything is fine. However, we're not dealing with at Out Of Memory issue (that I can tell of), as I have reduced my static buffer usage by ~30KB and the issue still occurs. So, can someone explain what the underlying problem here is? Is there a maximum amount that can be malloced from LwIP/STM32F2 (other than the total available memory...)?

-Dan

0 Likes

Scratch all that. It appears to be a memory corruption issue with the section of code. I'll address this later, but for now I'm leaving it out.

0 Likes