Questions tagged [gcc]

The GNU Compiler Collection (GCC) is a collection of open source compilers. Originally it only supported the C programming language but now also supports C++, Objective-C, Java and several other languages. The C and C++ compilers are popular for embedded development and support cross-compiling to many popular target processors.

54 questions
24
votes
7 answers

For embedded code, why should I use "uint_t" types instead of "unsigned int"?

I am writing an application in c for an STM32F105, using gcc. In the past (with simpler projects), I have always defined variables as char, int, unsigned int, and so on. I see that it is common to use the types defined in stdint.h, such as int8_t,…
bitsmack
  • 16,747
  • 9
  • 52
  • 108
19
votes
5 answers

Is Code Sourcery G++ Lite still a viable project?

When I tried to download a newer version of Code Sourcery G++ Lite for ARM, I noticed that I was redirected to another company and it is really hard to find anything on that site about Sourcery G++ Lite for ARM. Does anybody know the status on the…
Johan
  • 2,385
  • 2
  • 25
  • 27
17
votes
2 answers

STM32F2: Makefile, linker script and start-up file combination without commercial IDE

I have been working with an STM32F2 (specifically, the STM32F217IGH6 on a development board) for about two months. By far my biggest problem had to do with the "setup", which includes makefile, linker script and start-up file. In particular, I have…
Randomblue
  • 10,953
  • 29
  • 105
  • 178
11
votes
4 answers

Endian problem on STM32

I'm using arm gcc (CooCox) to program an STM32F4discovery, and I've been wrestling w/ an endian problem I'm sampling with a 24 bit ADC via SPI. Since three bytes are coming in, MSB first I had the idea of loading them into a union to make them (I…
Scott Seidman
  • 29,274
  • 4
  • 44
  • 109
10
votes
3 answers

Eclipse + GNU ARM + STM32 - HAL or SPL

I am going to start with ARM development (after 2 years of AVRs) and have picked up the STM DISCOVERY board with the stm32f4 microprocessor on it. I have decided to go with eclipse + ARM gcc since I don't like the code limit on Keil and I don't have…
Ankit
  • 1,751
  • 1
  • 27
  • 48
9
votes
2 answers

Move embedded programming from Keil to Linux

I'm currently using Keil to develop for an STM32 discovery board. My project is close to finished, and I'd like to move to a Linux based building environment. I've been using the preconfigured flashing tool and the STLink drivers for windows to…
Lg102
  • 479
  • 1
  • 4
  • 16
9
votes
4 answers

Why GCC compiler omitting some code?

I can not understand why GCC compiler cutting out part of my code while it preserve absolutely the same one in the neighborhood? The C code: #define setb_SYNCO do{(PORTA|= (1<<0));} while(0); ISR(INT0_vect){ unsigned char i; i = 10; …
Roman Matveev
  • 2,942
  • 7
  • 32
  • 75
8
votes
4 answers

Embedded C - Most elegant way to insert a delay

I'm working on a project involving a cortex-m4 mcu (LPC4370). And I need to insert a delay while turning on compiler's optimization. So far my workaround was to move up and down a digital output inside a for-loop: for (int i = 0; i < 50000; i++) { …
a_bet
  • 327
  • 4
  • 15
7
votes
2 answers

atmel studio for mac

Is Atmel Studio compatible with Mac or Linux? It seems like there is only Windows support from the downlaods here: http://www.microchip.com/mplab/avr-support/atmel-studio-7.
Joey Gough
  • 185
  • 1
  • 1
  • 8
6
votes
1 answer

Why is the AVR GCC compiler using a full `CALL` even though I have set the `-mshort-calls` flag?

I have set the -mshort-calls flag which is documented to replace the 4 byte long CALL instruction with the 2 byte long RCALL instruction when possible to save flash space and and cycles... -mshort-calls Assume that RJMP and RCALL can target the…
bigjosh
  • 9,888
  • 29
  • 48
6
votes
3 answers

Digital signal controller with GNU toolchain?

Does any manufacturer offer a digital signal controller (which basically means a microcontroller with some DSP functionality like a MAC instruction and other stuff) to which I could compile software with GCC? dsPIC apparently use Microchips own C30…
Dago
  • 910
  • 7
  • 12
6
votes
1 answer

What is relation between ARM libraries

What is relation between CMSIS libs released by ARM.com, libraries provided by manufacture and GCC ARM libraries ? What is the exact purpose of each? Which of them Should I use?
user62541
5
votes
1 answer

ARM startup file attributes vs GCC command line arguments

The startup files for STM32 Cortex-M MCU's, for most GCC toolchains, often bundle the Atollic TrueStudio startup assembly files with HAL libraries, like for example in my case, STM32CubeF4. I'm looking at startup_stm32f407xx.s, and it starts with a…
josef.van.niekerk
  • 3,600
  • 7
  • 44
  • 63
4
votes
1 answer

Unable to compile STM32F4 code sample with Eclipse

I'm trying to compile a simple STM32F4 sample using Eclipse with the GNU ARM Eclipse plugin from http://gnuarmeclipse.livius.net/blog/. I'm getting the following errors: and the structure is as follows: and the source code from main.c #include…
josef.van.niekerk
  • 3,600
  • 7
  • 44
  • 63
4
votes
1 answer

How does gnu linker obtain Cortex-M stack pointer value?

GNU's linker obtains the ARM Cortex's stack pointer value from the linker script, and places that value in the first location of the interrupt vector table. I note that most of my scripts use the symbol _estack to define the "end of stack" (memory…
CMiller
  • 51
  • 4
1
2 3 4