There is a crash on STM32F4 especially because of DMA behind I think (mainly DMA cannot send null data)
When size is NULL tested with serial-over-USB CDC driver => SDU1 & SDU2 on STM32F4.
Example code:
char str="\0";
chprintf((BaseSequentialStream )&SDU1, "%s", str);
chSequentialStreamWrite( (BaseSequentialStream )&SDU1,(uint8_t )NULL, 0);
I solved this problem by adding a check if size is greater than 0, but I think it should be fixed in driver or at lowest level, as size of 0 can happen with some chprintf() with argument NULL for example which is not always an error.
Anyway those problems shall be analyzed in more details.
Best Regards
Benjamin
Just an update with a clear example:
The problems is localized in os/kernel/src/chqueues.c
Where it stop on chDbgCheck, I think this assertion shall be removed and just return when size < 1.
Last edit: Benjamin Vernoux 2014-03-16
Does there is any news on this issue as it is trivial to solve it ?
Hi,
The zero size problem has been addressed in chprintf() but not in streams where zero will continue to be a reserved value.
Will be fixed in 2.7.0unstable, 2.6.4stable and 3.0.0development.
Giovanni