I am using FreeRTOS+TCP from FreeRTOS Lab Version 160919 on the Zedboard with a ZYNQ SOC.
I have set up an interrupt using a counter in the APU. My interrupt service routine contains the following snippet of code:
If I activate the interrupt I only get strange values in my UART console:
value: 23045066114377635280957554934828970424954912390364025862244197895673641598237541359790173769008596786348032.000000
If I start the interrupt without using FreeRTOS by leaving out the setup of the vector table and the start of the task scheduler in the main function, the value I get is the expected:
value: 2.3345
Could you please help me explain this behaviour? It seems the installation of the vector table corrupts the execution of printf in the ISR somehow. Printf with integer values works fine in both cases.
Not sure if this is the same thread I just replied to - but if this is
on a Cortex-A then an issue has been discovered with alignment for
floats inside an interrupt. If this effects you then please use float
outside of the ISR (printf() should not be used in an ISR really
anyway), and if that is not helpful get back to us here and we will let
you know the fix.
Yes, it is a Cortex-A9 processor. I need to use float in the ISR because I do some high frequency calculation which is controlled by a timer interrupt. The fix would be really helpful, thank you.
I think the fix is to change both occurrences of r0-r3 to r0-r4, which
adjusts the alignment of the stack within the vApplicationIRQHandler
function slightly.