Re: [libopencm3-devel] Random question vector dispatch

2014-05-30 Thread Michael Smith
On 30 May 2014, at 2:01 pm, Chuck McManis wrote: > What I really wanted was something like nvic_attach_interrupt(USART6, > uart_interrupts); I could give it a signature like nvic_attach_interrupt(enum > NVIC_SOURCE src, (void)(*vector)(void)) and do some type checking of the > validity of the

[libopencm3-devel] Random question vector dispatch

2014-05-30 Thread Chuck McManis
Could we do it better? So I was looking at vector dispatch. In part because I was looking at the half dozen or so startup files and multitude of pre-encoded vector files in the library. I wondered if all the processors of a given family could have a single startup file. The answer is yes if you

Re: [libopencm3-devel] Is anyone doing newlib nano programming?

2014-05-30 Thread Chuck McManis
Not a dumb question, and yes I've done a lot of work with the examples, although none of them use 'printf'. I wrote a set for the STM32F429 and the -Disco board [its a branch in my copy of the examples repo] and in those and others I was using my own handrolled gets() and puts(), getc(), and putc()

Re: [libopencm3-devel] Is anyone doing newlib nano programming?

2014-05-30 Thread Chuck McManis
Wow, great catch, the lack of the \n does in fact cause stdout not to flush, [face palm] ok then, on to bigger and better things. --Chuck On Fri, May 30, 2014 at 1:41 AM, Марко Краљевић wrote: > Yeah, this is a good point. Try adding this call before you print anything: > > setbuf(stdout, NUL

Re: [libopencm3-devel] Is anyone doing newlib nano programming?

2014-05-30 Thread Марко Краљевић
PS. or call fflush(); after your printf if you want to retain buffered IO otherwise. On 30 May 2014 02:41, Марко Краљевић wrote: > Yeah, this is a good point. Try adding this call before you print anything: > > setbuf(stdout, NULL); > > Looking through my code using newlib nano, I've got setbuf

Re: [libopencm3-devel] Is anyone doing newlib nano programming?

2014-05-30 Thread Марко Краљевић
Yeah, this is a good point. Try adding this call before you print anything: setbuf(stdout, NULL); Looking through my code using newlib nano, I've got setbuf() calls in all of them, so I presume it was buffering, causing me grief too. On 30 May 2014 01:25, wrote: > > > On 30 May 2014 08:07:41

Re: [libopencm3-devel] Is anyone doing newlib nano programming?

2014-05-30 Thread daniel
On 30 May 2014 08:07:41 BST, Chuck McManis wrote: >So I was looking at the newlib nano code and thinking "Oh cool, I can >use >printf" and have had some issues getting it to work. An example repo is >here: https://github.com/ChuckM/retarget-hang which demonstrates the >problem on the STM32F4-But

Re: [libopencm3-devel] Is anyone doing newlib nano programming?

2014-05-30 Thread Paul Fertser
Hi, On Fri, May 30, 2014 at 12:07:41AM -0700, Chuck McManis wrote: > So I was looking at the newlib nano code and thinking "Oh cool, I can use > printf" and have had some issues getting it to work. Worked fine for me in [1] (output via semihosting). [1] https://github.com/libopencm3/libopencm3-e

[libopencm3-devel] Is anyone doing newlib nano programming?

2014-05-30 Thread Chuck McManis
So I was looking at the newlib nano code and thinking "Oh cool, I can use printf" and have had some issues getting it to work. An example repo is here: https://github.com/ChuckM/retarget-hang which demonstrates the problem on the STM32F4-Butterfly with the Embest BaseBoard --Chuck