Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years ago.
mbed rtos build errors in Kinetis design studio?
I try to export the frdm_rtos example program from mbed to Kinetis design studio. After import the project into KDS and build it, KDS reports error in rtx folder "rt_Task.c" file.
The error is: undefined reference to `rt_get_PSP' rt_Task.c /frdm_rtos/mbed-rtos/rtx line 232 C/C++ Problem
Then I search all the files, found in HAL_CM4.s file:
- U32 rt_get_PSP (void);
.thumb_func .type rt_get_PSP, %function .global rt_get_PSP rt_get_PSP: .fnstart .cantunwind
MRS R0,PSP BX LR
.fnend .size rt_get_PSP, .-rt_get_PSP
It seems KDS recognizes the command after "#" is comment in .s file. But in the files, there are a lot of "#". Anyone confronted the similar problem and how can we fix it?
Thanks in advance.
2 Answers
9 years, 2 months ago.
I was absolutely pulling my hair out trying to sort this one out. I was in a situation where as a hobby I was quite happy to use MBED on my K64F to do whatever, but knew I probably wouldn't be allowed to use MBED at work. I really wanted to use a K64F but didn't want to fork out £500 odd for Keil so I started using KDS. KDS has a steep learning curve so I figured I could write some code on MBED and port it to KDS, but I couldn't for the life of me understand why the examples didn't compile. Now after spending a few hours messing about with KDS I understand exactly what the above post means. The .s files in the project location mbed-rtos\rtx\TARGET_CORTEX_M\TARGET_M4\TOOLCHAIN_GCC need to be renamed and it all works as it is supposed to...
Sorry you've had this problem. Not sure which version of the libraries you are using but I submitted a PR to fix all the files in the repo specifically for this problem. Can you confirm that you are using a version of the RTOS that is quite old??
https://github.com/mbedmicro/mbed/pull/1205
posted by 30 Aug 2015just to be clear, I was using KDS 3.0.0, with MQX 4.2, and SDK 1.2.0. The guys at Freescale actually came in to work and demoed KDS 3.0 for me when it first came out, so I defnitely have all the latest stuff. Thankfully it is all working now. I cant wait to delve into RTOS stuff.
posted by 30 Aug 20159 years, 9 months ago.
I had the same problem and I fixed it by renaming both files SVC_Table.s and HAL_CM4.s to SVC_Table.S and HAL_CM4.S. It seems KDS interprets them a different way if they are of different file extensions?
try to capitalize the extension to .S. There's one issue reported on github. I can post a reference if you confirm is that one
posted by Martin Kojtal 28 Oct 2014I just took the basic LED blinky program, added mbed-rtos, then exported to KDS. It opened and built fine without any problems. *However*, calling Thread::wait(100) causes the program to enter SVC_Handler, which I have now defined in my program. I'm just not sure what to do with the passed in value of 0x64...
posted by Dave M 09 Dec 2014