micropython assembly code compilation error with keil v5.18

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
chitturi123
Posts: 7
Joined: Mon Jan 16, 2017 6:11 am

micropython assembly code compilation error with keil v5.18

Post by chitturi123 » Tue Jun 20, 2017 4:50 am

I was using micropython library for my project with CoIDE with gcc tool chain.
There is no problem of compilation.
Later i shifted to Keil IDE with armcc tool chain.
But i have compilation errors in assembly code.

In micropython/py/nlrthumb.c file the following error message was thrown out

O
__attribute__((naked)) unsigned int nlr_push (nlr_buf_t *nlr) {
__asm volatile (
"str r4, [r0, #12] \n" // store r4 into nlr_buf
"str r5, [r0, #16] \n" // store r5 into nlr_buf
"str r6, [r0, #20] \n" // store r6 into nlr_buf
"str r7, [r0, #24] \n" // store r7 into nlr_buf
"str r8, [r0, #28] \n" // store r8 into nlr_buf
"str r9, [r0, #32] \n" // store r9 into nlr_buf
"str r10, [r0, #36] \n" // store r10 into nlr_buf
"str r11, [r0, #40] \n" // store r11 into nlr_buf
"str r13, [r0, #44] \n" // store r13=sp into nlr_buf
"str lr, [r0, #8] \n" // store lr into nlr_buf
"b nlr_push_tail \n" // do the rest in C
);


..\..\..\Micropython\py\nlrthumb.c(49): error: #549: variable "R0" is used before its value is set
"str r4, [r0, #12] \n" // store r4 into nlr_buf
..\..\..\Micropython\py\nlrthumb.c(49): error: #549: variable "R4" is used before its value is set
"str r4, [r0, #12] \n" // store r4 into nlr_buf
..\..\..\Micropython\py\nlrthumb.c(49): error: #549: variable "R5" is used before its value is set
"str r4, [r0, #12] \n" // store r4 into nlr_buf

It is throwing errors for all the lines.
Please help me to remove the compilation errors.

Post Reply