Hello,
I am using MMC SPI to log float values to microSD card using STM32F4 MCU and Chibios 2.6.5.
I have mostly followed demo from chibios. I am using snprintf() function to convert float to string and then write them file.
This method works perfectly when I call write function from main thread. However when I call this write function from any other static thread, I get 0 and -268156 values written on SD card and none of expected value.
I have added syscall.c to makefile.
Am I missing something? Is there any difference in the execution of main thread and any other static thread?
--
Nikhil
Problem using snprintf() in static thread
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Problem using snprintf() in static thread
Probably a stack overflow, libraries are not exactly designed for embedded.
Giovanni
Giovanni
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Problem using snprintf() in static thread
Tried using chsnprintf() but it also gives 214748368s and 0s instead of desired values.
--
Nikhil
--
Nikhil
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times