Page 5 of 5

Re: SD-Card Insert/Remove Handlers

Posted: Mon Feb 10, 2014 10:46 am
by Tabulous
so the panic msg is saying stack overflow, but is i said earlier if i increase the the thread static WORKING_AREA(waThread1, 128); from 128 (default value) upto 512, it then hits the _unhandled_exception

Re: SD-Card Insert/Remove Handlers

Posted: Mon Feb 10, 2014 10:55 am
by Tabulous
the unhandled_exception is hit when chThdSleepMilliseconds(1000); is called in the blinker thread

Re: SD-Card Insert/Remove Handlers

Posted: Mon Feb 10, 2014 10:56 am
by Giovanni
By examining the stack areas you can understand which stack is overflowing, if you use ChibiStudio then the ChibiOS debug view does that for you.

Giovanni

Re: SD-Card Insert/Remove Handlers

Posted: Mon Feb 10, 2014 11:02 am
by Tabulous
do i need to enable this as by default the ChibiOS/RT view as nothing in it all fields and tabs are empty

Re: SD-Card Insert/Remove Handlers

Posted: Mon Feb 10, 2014 11:28 am
by Tabulous
right declaring the varibles the are used by the f_open locally caused the _unhandled_exception

FIL file;
UINT wbytes;
FRESULT result;
char msgstr[40];

if i then increased WORKING area to 512 all is working.

The RT view is working now, that must have been down to the stack issues.

Re: SD-Card Insert/Remove Handlers

Posted: Mon Feb 10, 2014 11:39 am
by Tabulous
Now have a working USB-CDC and SD-Card Demo for STM3241G-EVAL board.

Giovanni - if you would like this demo for your repository let me know and i'll send it to you :-)

Thanks for teh help

Re: SD-Card Insert/Remove Handlers

Posted: Mon Feb 10, 2014 12:00 pm
by Giovanni
Hi,

If you could post a ready-to-go zip file in the contributions forum it would be great.

About the ChibiOS view, you need to hit the refresh button in the toolbar.

Giovanni

Re: SD-Card Insert/Remove Handlers

Posted: Thu Sep 11, 2014 7:58 am
by Jeroen3
Returning from

Code: Select all

DWORD create_chain(FATFS* fs,   DWORD clst )

At the B instruction, seem to throw an hardfault in ff.c from fatfs R0.10b.

This gets called from f_stat, all other fatfs functionality seems ok.

Re: SD-Card Insert/Remove Handlers

Posted: Fri Sep 12, 2014 12:50 pm
by Jeroen3
This is because a FILINFO structure is assumed to be "empty" when filled with 0. When filled with standard stackfill of 0x55 it will crash.
It was in reaction to mukululul a few pages back, not very on topic anymore.

Re: SD-Card Insert/Remove Handlers

Posted: Fri Sep 12, 2014 2:33 pm
by Giovanni
Good to know anyway :)

Giovanni