Page 1 of 1
Trouble with dma vectors on 2.4.0 and variadic on 2.2.8
Posted: Mon Mar 12, 2012 6:04 pm
by crust
I've been porting my application from 2.2.8 to 2.4.0. Really, I could use either one, but I never could get variadic functions to work in 2.2.8. It would crash with just va_start and va_end in use. I am using Linaro GCC 4.6-2012.02 & newlib. On 2.4 my app will not link.
The problem is that I've got some hand coded assembly routines I use that also work with the interrupts Vectors 74,7C,70,84. These overlap the DMA vectors in st32_dma.c and I cannot figure out how to override those with mine. -or- how can turn off the HAL since I really use this for messaging and threading. On 2.2.8 this wasn't a problem because the Vectors were "weak" so I could override them.
Thanks
Re: Trouble with dma vectors on 2.4.0 and variadic on 2.2.8
Posted: Mon Mar 12, 2012 7:09 pm
by Giovanni
Hi,
There is currently no simple solution for this problem, you could comment out the ISRs into stm32_dma.c or rename the vectors in vectors.c (the linker would remove the unreferenced ISRs in stm32_dma.c), I'll add to the todo list a workaround for this, most likely an option setting for each DMA ISR vector.
If you want to exclude the HAL just comment out the "include $(CHIBIOS)/os/hal/hal.mk" in the makefile, there is also an example of HAL-less demo in 2.4.0.
Giovanni
Re: Trouble with dma vectors on 2.4.0 and variadic on 2.2.8
Posted: Tue Mar 13, 2012 3:56 pm
by crust
Thanks, I gave it a quick try but didn't have much luck. I am considering just using 2.2.8 for now (where most everything is working for me). However, I would like to be able to get variadic functions to work on it. I haven't been able to figure out why they don't. I suspect it is something with newlib, but no idea what it could be. Any ideas?
Re: Trouble with dma vectors on 2.4.0 and variadic on 2.2.8
Posted: Tue Mar 13, 2012 3:59 pm
by Giovanni
The function chprintf() uses those and it works, does that function work for you? I tested it using YAGARTO/gcc 4.6.2.
About 2.2.8, it is fine, support for 2.2.8 should be guaranteed for the whole 2012.
Giovanni
Re: Trouble with dma vectors on 2.4.0 and variadic on 2.2.8
Posted: Tue Mar 13, 2012 4:43 pm
by crust
chprintf does not exist on 2.2.8 ... in fact, i was using one of my old embedded printfs for debug which is when I first found that that variadic did not work.
I have to do more porting to get 2.4.0 to work on my board, so I cant try it yet.
Re: Trouble with dma vectors on 2.4.0 and variadic on 2.2.8
Posted: Wed Mar 14, 2012 5:41 am
by crust
Finally figured it out ... it wasn't the variadic function. That was never being called. I'd forgotten about this bold optimization that gcc likes to do. Given a static string (eg. printf("hello"); ), gcc optimizes that to a puts invocation. I have my own methods for printf and friends, but I did not have a puts. Once I added a braindead puts all is well.
Thanks,