cancel
Showing results for 
Search instead for 
Did you mean: 

Assembler error after upgrade to Ver 2.1: bad instruction `rtc ldr sp,=_estack'

erastusC
Associate III

Good day,

After I did an upgrade to the latest version when I compile I get this error.

Where can I get documentation on this.

Never did an upgrade without issues.

make -j48 all

arm-none-eabi-gcc -mcpu=cortex-m4 -g3 -DDEBUG -c -x assembler-with-cpp -MMD -MP -MF"Startup/startup_stm32f411ceux.d" -MT"Startup/startup_stm32f411ceux.o" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "Startup/startup_stm32f411ceux.o" "../Startup/startup_stm32f411ceux.s"

../Startup/startup_stm32f411ceux.s: Assembler messages:

../Startup/startup_stm32f411ceux.s:61: Error: bad instruction `rtc ldr sp,=_estack'

make: *** [Startup/subdir.mk:19: Startup/startup_stm32f411ceux.o] Error 1

1 ACCEPTED SOLUTION

Accepted Solutions

Note that everybody can see all posts - there's no need to repeat the same thing in separate replies to each person.

You can mention multiple people in a post using '@'

 


@erastusC wrote:

I did a search in the C code .


As noted above, it's not in the C code - it's an Assembler error.

The error message tells you this, and identifies the file & line number where the error occurred:

../Startup/startup_stm32f411ceux.s: Assembler messages:

../Startup/startup_stm32f411ceux.s:61: Error: bad instruction `rtc ldr sp,=_estack'

So the file name is startup_stm32f411ceux.s

That file is located in the Startup folder

The :61: is the line number within the file.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

View solution in original post

11 REPLIES 11
mƎALLEm
ST Employee

Hello,


@erastusC wrote:

After I did an upgrade to the latest version when I compile I get this error.


last update of what? tool? software package? which one?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
TDK
Super User

Looks like "rtc" was typed somewhere it shouldn't have been. Maybe that window was active when you didn't expect.

Create a new project and copy the startup file to recover.

I don't think this has anything to do with upgrading STM32CubeIDE. The compiler hasn't changed. This is a compiler error. If the file is the same, it will produce the same results.

If you feel a post has answered your question, please click "Accept as Solution".

@TDK wrote:

This is a compiler error. .


Actually, it's an Assembler error:

../Startup/startup_stm32f411ceux.s: Assembler messages:

../Startup/startup_stm32f411ceux.s:61: Error: bad instruction `rtc ldr sp,=_estack'

 


@TDK wrote:

Looks like "rtc" was typed somewhere it shouldn't have been. 


Indeed.

I think the code should be something like this:

Reset_Handler:
ldr r0, =_estack
mov sp, r0 /* set stack pointer */

 

 


@TDK wrote:

Maybe that window was active when you didn't expect.


Possibly due to this long-running issue: Jumping to random file after pressing Run button

@erastusC - Specifically, this.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Thank you for the pedantic correction. I'm not sure it changes the overall message.

If you feel a post has answered your question, please click "Accept as Solution".

I did a search in the C code and there is no error showing or I could not find any place where rtc was incorrectly typed.  It gets generated when it gets compiled.

I have no idea to search for it as I did not work in assembler.

I did a search in the C code and there is no error showing or I could not find any place where rtc was incorrectly typed. It gets generated when it gets compiled.

I have no idea to search for it as I did not work in assembler.

It's in your "startup_stm32f411ceux.s" file.

If you feel a post has answered your question, please click "Accept as Solution".

Note that everybody can see all posts - there's no need to repeat the same thing in separate replies to each person.

You can mention multiple people in a post using '@'

 


@erastusC wrote:

I did a search in the C code .


As noted above, it's not in the C code - it's an Assembler error.

The error message tells you this, and identifies the file & line number where the error occurred:

../Startup/startup_stm32f411ceux.s: Assembler messages:

../Startup/startup_stm32f411ceux.s:61: Error: bad instruction `rtc ldr sp,=_estack'

So the file name is startup_stm32f411ceux.s

That file is located in the Startup folder

The :61: is the line number within the file.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

Thanks a mil.  There was a RTC not sure where that came from.

I copied your software and voila it works.

Many thanks