N
N
Nikita Presnov2020-09-06 13:41:39
ARM
Nikita Presnov, 2020-09-06 13:41:39

How to convert code for ICCARM to GNUC?

There was a piece of code in iare.

#if defined (__ICCARM__)
#define __vectors   __root const uVectorEntry __vector_table[] @ ".intvec"
#define __stack     { .ui32Ptr = (uint32_t)Stack + sizeof(Stack) }
typedef union
{
  void (*Handler)(void);
  uint32_t ui32Ptr;

} uVectorEntry;
#endif

It needs to be redone for GCC.

Everything after defines along the way also does not depend on the compiler.
Perhaps the reaction requires only 1 line after ifa.

Details.
This is the startap file for stm32f103c8t6(Cortex-M3).
More like a small piece of it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikita Presnov, 2020-09-09
@discipuli

#define __vectors void (*const __vector_table[])(void) __attribute__((section(".isr_vector")))
+ correct linker script, or even a default startup from the cube.

J
jcmvbkbc, 2020-09-06
@jcmvbkbc

It needs to be redone for GCC.

To do this, you first need to figure out what he does. Then learn how it's done in gcc. Then redo.
Perhaps the reaction requires only 1 line after ifa.

Maybe. But you can't see it from here. You can place a variable in the desired section in gcc with the __attribute__((section("имя секции"))). See _

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question