FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [September 2010 Threads] Adding a printf call causes Demo to crashPosted by slrz1eqr on September 22, 2010 Hi forum, I am currently toying with the ARM7_LPC2129_Keil_RVDS demo on the Keil uVision3 simulator. The problem I've encountered is that when I insert a printf() call anywhere in main(), the application crashes at startup before even reaching main(). The simulator says: “Data Abort: ARM Instruction at 0000155CH, Memory Access at E3A02066H” The processor is in Supervisor mode before the call to vTaskStartScheduler(), as required. Any ideas?
RE: Adding a printf call causes Demo to crashPosted by slrz1eqr on September 22, 2010 Sorry, forgot to mention that I'm using FreeRTOS V6.0.5.
RE: Adding a printf call causes Demo to crashPosted by Richard on September 22, 2010 “emo on the Keil uVision3 simulator” Thank you for stating that up front. The simulator is not the environment on which the port was developed or intended to run. Normally when people report problems in a simulated environment the problem does not exist in the real environment. “nsert a printf() call anywhere in main()” “the application crashes at startup before even reaching main()” If the print is in main(), and it is crashing in the startup code, then your problem is not (yet at least) related to FreeRTOS anyway. The kernel does not start and the stack pointer is not manipulated until the kernel vTaskStartScheduler() is called. Up to that point, you just have a standard single threaded C program. I don't know where printf() is supposed to print to in the Keil tools. Have you configured it to actually do something (print to COM port, debug terminal, or the like?). Is it attempting to use memory that has not been allocated? Etc. Etc. Regards. [ www.freertos.org/FAQ-how-to-use-the-FreeRTOS-support-forum.html ] I think you are asking the question in the wrong place. Keil tech support should be able to answer questions about using printf() and about using their simulator. Regards.
RE: Adding a printf call causes Demo to crashPosted by slrz1eqr on September 30, 2010 Just in case anyone is interested. When you add printf() or some other I/O or memory management C functions to your code, Keil C links in some library modules which make SWI calls at startup. This results in vPortYieldProcessor() being called before vTaskStartScheduler(). To avoid this, you should add to your code: #pragma import(__use_no_semihosting_swi) You will also have to retarget some of the library functions like fputc(), fgetc(), etc. In my case, the addition of \Keil\ARM\Startup\retarget.c to my project was enough. For more info, see Building an application for a nonsemihosted environment. All the best.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|