Search found 14 matches

by JamesS
Mon Jan 13, 2014 2:24 am
Forum: User Projects
Topic: [TODO] HAL for Watchdog timer (for STM32F10x)
Replies: 6
Views: 8852

Re: [TODO] HAL for Watchdog timer (for STM32F10x)

Now trying on STM32F407.

Integrated and builds clean.

Thanks.

James.
by JamesS
Mon Jan 13, 2014 1:23 am
Forum: STM32 Support
Topic: stm32f4 discovery fatfs problem
Replies: 31
Views: 29046

Re: stm32f4 discovery fatfs problem

I added some more debugging output to the "threads" command;

ChibiOS/RT Shell
ch> threads
addr stack (limit) prio refs state time name
20000A28 20000754(20000400) 64 1 WTOREVT 0 main
20000968 200009C4(200009B4) 1 1 READY 311670 idle
20003970 200039EC(200039BC) 2 1 READY 0 usb_lld_pump
2000BBF8 ...
by JamesS
Sun Jan 12, 2014 10:59 pm
Forum: STM32 Support
Topic: stm32f4 discovery fatfs problem
Replies: 31
Views: 29046

Re: stm32f4 discovery fatfs problem

Hi Giovanni,

I was reading about stack space and enabled CH_DBG_ENABLE_STACK_CHECK and CH_DBG_FILL_THREADS, and increased the blinker thread WA size to 1024 bytes, but haven't yet looked at the stacks to see how much room there is.

Regards,
James.
by JamesS
Fri Jan 10, 2014 5:46 am
Forum: STM32 Support
Topic: stm32f4 discovery fatfs problem
Replies: 31
Views: 29046

Re: stm32f4 discovery fatfs problem

Nope it was a fluke. The function won't run reliably even from the blinker thread.

Regards,
James.
by JamesS
Fri Jan 10, 2014 4:53 am
Forum: STM32 Support
Topic: stm32f4 discovery fatfs problem
Replies: 31
Views: 29046

Re: stm32f4 discovery fatfs problem

Seems there was a stack overflow or similar. Running my function from the blinker thread works once I've increased the working area substantially. Currently;

Code: Select all

static WORKING_AREA(waThread1, 4096);


Could this be the same reason that my function fails to run from the main() loop?

Regards,
James.
by JamesS
Fri Jan 10, 2014 4:34 am
Forum: STM32 Support
Topic: stm32f4 discovery fatfs problem
Replies: 31
Views: 29046

Re: stm32f4 discovery fatfs problem

The 5ms timeout change to 50ms has certainly improved matters, but I'm not quite out of the woods.

I can run the sdiotest command from the shell as many times as you like, and it succeeds every time without needing to retry.

I have a function that opens a file on the SD card, reads and parses the ...
by JamesS
Fri Jan 10, 2014 12:35 am
Forum: STM32 Support
Topic: stm32f4 discovery fatfs problem
Replies: 31
Views: 29046

Re: stm32f4 discovery fatfs problem

Thanks, Giovanni, but it didn't help.

I reverted sdc_lld.c and moved the SDIO->DCTRL = ... code to before sdc_lld_prepare_read(...). From the sdiotest code I got;

ChibiOS/RT Shell
ch> sdiotest
Trying to connect SDIO... OK
*** Card CSD content is: 400E0032 5B590000 1D8A7F80 A4040B8
Single aligned ...
by JamesS
Thu Jan 09, 2014 2:51 am
Forum: STM32 Support
Topic: stm32f4 discovery fatfs problem
Replies: 31
Views: 29046

Re: stm32f4 discovery fatfs problem

I changed sdc_lld_read to look like


int retries = 10;
bool_t rv;
do {
rv = sdc_lld_read_aligned(sdcp, startblk, buf, n);
} while (rv != CH_SUCCESS && --retries);

retries = 10 - retries;
if (max_retries < retries) max_retries = retries;

return rv;


And made max_retries a global and ...
by JamesS
Thu Jan 09, 2014 1:47 am
Forum: STM32 Support
Topic: stm32f4 discovery fatfs problem
Replies: 31
Views: 29046

Re: stm32f4 discovery fatfs problem

The test does an sdcRead(...) and gets to;

Breakpoint 1, sdc_lld_wait_transaction_end (sdcp=0x20003680, n=1, resp=0x20007074)
at ../os/hal/platforms/STM32/sdc_lld.c:170
170 if ((SDIO->STA & SDIO_STA_DATAEND) == 0) {
(gdb) p *(0x40012c34)
$1 = 8

8 == SDIO_STA_DTIMEOUT

So, in the sdiotest I put ...
by JamesS
Wed Jan 08, 2014 6:22 am
Forum: STM32 Support
Topic: stm32f4 discovery fatfs problem
Replies: 31
Views: 29046

Re: stm32f4 discovery fatfs problem

Nope. Nothing has worked.

I tried the testhal sdiotest and the output hangs..

ChibiOS/RT Shell
ch> sdiotest
Trying to connect SDIO... OK
*** Card CSD content is: 400E0032 5B590000 1D8A7F80 A4040B8
Single aligned read... [board is well hung at this point.]

James.