Search found 608 matches

by steved
Mon Sep 16, 2019 8:58 pm
Forum: General Support
Topic: c++ callback function in class
Replies: 4
Views: 76

Re: c++ callback function in class

Have a 1-line C function which calls the C++ function. The parameter to the callback is the object pointer.
by steved
Mon Sep 16, 2019 8:55 pm
Forum: Development and Feedback
Topic: [NOTES] Sandbox concept
Replies: 15
Views: 477

Re: [NOTES] Sandbox concept

Giovanni wrote:Posix is huge, the implementation it is limited to file handle functions on standard descriptors so far. Pthreads would be difficult unless a sub-scheduler is placed directly into the sandbox.

That's a pity; PThreads is probably the second most useful part of Posix to implement, IMO.
by steved
Sun Sep 15, 2019 9:20 pm
Forum: Development and Feedback
Topic: [NOTES] Sandbox concept
Replies: 15
Views: 477

Re: [NOTES] Sandbox concept

Giovanni wrote:I am going for a subset of Posix API too

Posix APIs are, in general, a good idea IMO. It's becoming increasingly possible to use 3rd party libraries which expect a Posix API, and having a proper implementation would be useful. (This includes a Posix wrapper for many RTOS functions)
by steved
Sun Sep 08, 2019 9:40 pm
Forum: STM32 Support
Topic: Hard fault when exiting stop mode with RTC alarm on STM32F051
Replies: 13
Views: 246

Re: Hard fault when exiting stop mode with RTC alarm on STM32F051

Often hard faults turn out to be the result of a stack overflow (not always on the thread which generates the hard fault). Or sometimes a bad pointer, so a write goes to somewhere it shouldn't. So you could look in detail at the offending instruction - check register values, and what they mean in th...
by steved
Sat Aug 31, 2019 8:26 pm
Forum: Bug Reports
Topic: chprintf() - float precision
Replies: 2
Views: 178

Re: chprintf() - float precision

Thanks Bob - I'll add that to my mods
by steved
Thu Aug 29, 2019 8:59 am
Forum: Bug Reports
Topic: chprintf() - float precision
Replies: 2
Views: 178

chprintf() - float precision

chprintf() doesn't print a float correctly when the precision comes from a variable - "%1.*f" prints "*f"
Added line 204 in the attached; moves source pointer on after reading and actioning the '*'
by steved
Sun Aug 25, 2019 8:24 am
Forum: STM32 Support
Topic: STM32F103C8 Blue pill with ChibiOS Topic is solved
Replies: 2
Views: 134

Re: STM32F103C8 Blue pill with ChibiOS Topic is solved

To start, use a board file that has the same processor on it (or as close as you can get). Then adapt it.

Others have certainly used the Blue Pill board, so a forum search should yield some tips.
by steved
Fri Aug 23, 2019 8:22 am
Forum: Bug Reports
Topic: strncpy() Topic is solved
Replies: 3
Views: 137

Re: strncpy() Topic is solved

It is known, the rationale is that the object name has a known maximum length, string functions are never used unless in the "n" variant. Looking at dyn_create_object_pool(), for example, it's called from chFactoryRegisterObject(), which is a public api function. Thus if the passed object...
by steved
Thu Aug 22, 2019 1:29 pm
Forum: Bug Reports
Topic: strncpy() Topic is solved
Replies: 3
Views: 137

strncpy() Topic is solved

One of those arguable ones! There's some use of strncpy() - in chfactory.c and nasa_cfe\osal\src\osapi.c It's potentially unsafe because you can end up with an unterminated string. strlcpy() is a safer option - although not in the C standard, its available in GCC and various other environments. And ...
by steved
Fri Aug 16, 2019 2:18 pm
Forum: General Support
Topic: Modifying board.c
Replies: 1
Views: 109

Modifying board.c

I have a board where board.c needs to differ from the auto-generated template using board.chcfg. The differences include using a #define to disable GPIO setup, for example. Also adding a couple of board-specific routines. Is there a way to achieve this within the existing structure? (I realise I can...

Go to advanced search