SIGINT interrupt with FreeRTOS Blinky running from RAM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SIGINT interrupt with FreeRTOS Blinky running from RAM

1,936 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hzoli on Tue Nov 25 05:50:46 MST 2014
Hi,

I have a LPC4320 Freertos project running from RAM using LPCXpresso V7.5.
The project is downloaded into a customer board.
I always get SIGINT interrupt in prvPortStartFirstTask() function at calling SVC interrupt.
I have the same problem with LPCOpen Freertos blinky example project when running from RAM.
I searched this forum, but the only thing I have found, that it is caused by WFI, but it is not called in my project.
Could anyone tell me how to solve this problem?
Thanks
Zoltan
0 Kudos
9 Replies

1,315 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hzoli on Fri Nov 28 05:28:21 MST 2014
I tried your first suggestion powering up the board while keeping P2_7 pin low to make MCU enter into ISP mode.
Then FreeRTOS has started successfully.
Many thanks for your help.
Regards,
Zoltan
0 Kudos

1,315 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Thu Nov 27 05:55:20 MST 2014
Using your image, I can replicate but not consistently. My suspicion is that this is something to do with the way the debug tools take control of the board for debugging a RAM image - particularly if you have something in flash which is getting run before the debugger connects.

Can you try the following and see if any of them make any difference to the behaviour you are seeing:

1) When you turn on the board (or reset it), ensure that you pull ISP to stop any code in flash being run. Now try debugging your RAM image.

2) Set the boot pins for your boot so that the MCU comes up in DFUboot mode (rather than running any code in flash). Now try debugging your image.

3) If you have your board configured to boot from SPIFI flash, create a simple non-lpcopen C project (and don't link to any driver libraries), configure this to be download and run from your flash. Debug this. Then try debugging your RAM image.

Regards,
LPCXpresso Support


0 Kudos

1,315 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hzoli on Thu Nov 27 05:28:12 MST 2014
I am using LPC-Link 2 connecting via Red Link Server.

I think I am using the right launch configuration script (LPC18LPC43RamReset.scp), so I attach all of the info you requested.
Linker map file is included in project. I changed the original FreeRTOS Blinky LED project to comment out board specific parts:
Board_Init() and Board_LED_Set() calls.

My LPC part is LPC43S20FBD144, and an external SDRAM type 48LC4M16A2 and external SPIFI NOR flass type S25FL164K are also populated on the board.

I also attached the LPCXpresso screenshot when debugger stopped.
0 Kudos

1,315 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Wed Nov 26 09:22:28 MST 2014
What debug probe are you using? In particular if it is an LPC-Link2  (or another probe that connects via 'redlink server') then make sure you are running the correct connection script if downloading your image directly into RAM. This has been covered a few times in previous threads, for example:

http://www.lpcware.com/content/forum/how-build-and-debug-lpc-link-2-lpcxpresso-iram-only-projects

If you are still having problems then please:

1) Post your debug log:

http://www.lpcware.com/content/faq/lpcxpresso/debug-log

2) Post the linker map file

3) Confirm the actual part number from the top of the MCU on your board. Also confirm what, if any, external memory you are using.

4) And if at all possible, provide an example project that shows up the problem:

http://www.lpcware.com/content/faq/lpcxpresso/how-importexport-projects

For future reference, please also see our LPC43 related FAQs, starting at:

http://www.lpcware.com/content/faq/lpcxpresso/lpc18-lpc43-support

Regards,
LPCXpresso Support.
0 Kudos

1,315 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hzoli on Wed Nov 26 08:25:52 MST 2014
VTOR is set correctly. The project is started and stops first at the beginning of main().
Error comes at executing 'svc 0' in prvPortStartFirstTask() function.
I also checked in vector table that SVC_Handler, PendSV_Handler and SysTick_Handler addresses in vector table pointing to vPortSVCHandler, xPortPendSVHandler and xPortSysTickHandler ported by FreeRTOS.
The project works as expected if I run it from external SPIFI NOR flash.
Thanks for your reply.
0 Kudos

1,315 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by whitecoe on Wed Nov 26 04:58:31 MST 2014
If you are running from RAM, you might need to check where VTOR (Vector Table Offset Register) is set for. Otherwise exceptions may not jump to where you think they should.

HTH!

0 Kudos

1,315 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Wed Nov 26 03:53:25 MST 2014
SIGINT will normally be an indication that the debugger has trapped a hard fault or similar. For more information see:

http://www.lpcware.com/content/faq/lpcxpresso/debugging-hard-fault

But the fact that this is on the SVC might be explained by you not having the FreeRTOS SVD handler properly installed within your application. For background on handlers, see:

http://www.lpcware.com/content/faq/lpcxpresso/startup-code-interrupt-handlers

Regards,
LPCXpresso Support
0 Kudos

1,315 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by hzoli on Wed Nov 26 03:51:47 MST 2014
Richard,
Thank you for the answer.
SIGINT is actually not an ARM or Processor specific interrupt, I am not sure but I think it is somehow related to LPC-Link 2 debugger I use.

When I run the code the debugger stops the execution of code at SVC call without setting any breakpoint.
I use the the Freertos blinky example unchanged, that is delivered with LPCXpresso install. Freertos specific interrupt handlers are installed by defining them in FreeRTOSConfig.h Freertos version is V7.6.0.

#define vPortSVCHandler SVC_Handler
#define xPortPendSVHandler PendSV_Handler
#define xPortSysTickHandler SysTick_Handler

It also works if I run the image from SPIFI flash. I only have this problem when I run the code from internal RAM.
Best regard,
Zoltan
0 Kudos

1,315 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by www.FreeRTOS.org on Wed Nov 26 02:32:51 MST 2014
I can't answer your question directly because I don't know what a sigint interrupt is in relation to either an ARM Cortex-M or an LPC43xx.  I have searched the ARM technical reference manual, ARM architecture reference manual, and LPC4320 user manual for "sigint" and don't get any hits.

However, if you are getting a problem with the prvPortStartFirstTask() function the first thing to look at is the vector table.  Have you installed the FreeRTOS interrupt handlers?  See the "Special note for Cortex-M users" in the first item of the following FAQ page: http://www.freertos.org/FAQHelp.html

0 Kudos