Questions tagged [compiler]

A compiler transforms code written in a source language to a (binary) target language.

Filter by
Sorted by
Tagged with
36
votes
13answers
22k views

ARM Cortex-M3 development tools?

I am planning to migrate to the NXP Cortex M3 architecture and I'm a little lost between the existant development tools. Keil is expensive and I don't know if it's worth it. Anyone who has tried some ...
28
votes
9answers
4k views

What is the process of going from machine code to electrically controlling individual transistors? [closed]

For someone who writes software but doesn't have a computer engineering background, the dozens of abstraction layers have always bewildered me. I know all source code in their most fundamental level ...
23
votes
7answers
2k views

What do HDLs compile/synthesize to?

I'm a software engineer. As a programmer, I have an understanding of what my compiler does for me because I've manually written a close textual representation of what it outputs (e.g. assembly). For ...
18
votes
5answers
18k views

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++ ...
16
votes
12answers
7k views

Could you program a microcontroller without a computer?

Let's say you had a rather simple and small microcontroller and had no interfacing, no computer, no debugger, compiler, or assembler. Could you write your code in assembly, convert it (manually) to ...
13
votes
2answers
3k views

Compiling code to run from external RAM

I am considering designs for a minimalist game system based on a PIC18F85J5. Part of my design is that games can be loaded from an SD card without reprogramming the chip or flashing the program memory....
13
votes
2answers
6k views

How can I use a build server with Keil uVision4 (MDK-ARM), script a build, use a makefile?

I would like run daily builds, or check-in/commit triggered builds of Keil MDK-ARM based projects. So far I've gotten things going with the batch file feature of the IDE. This does require you to ...
12
votes
2answers
3k views

What is 'unsigned char near'?

I read a datasheet and I found variable defined as unsigned char near Sample_X. What is this, and how does this differ from ...
11
votes
3answers
14k views

How to discover memory overflow errors in the Arduino C code?

Several times I had some suspicious outputs on the Serial Monitor after uploading code to the Arduino: like eternal output of whitespaces or suddenly cut of strings or scrambled strings. Because ...
11
votes
3answers
14k views

Programming for the Arduino without the Arduino IDE.. but with the provided libraries?

I recently started a new project using my Arduino that's been collecting dust for a while. Along with the physical board collecting dust, so has my copy of avr-gcc and the Arduino libraries. I can ...
11
votes
1answer
2k views

PIC18F4550 C-compiler that's open-source & cross-platform?

I'm a long time AVR user. I really like that AVR-GCC works on the two main OSes I use (Mac OS X and Linux), is open-source, and is supported by Atmel. I'd like to get back into PIC programming (used ...
9
votes
5answers
13k views

ATTiny13 — avr-gcc Hello World uses over 100 bytes?

I'm trying to write a program for the ATTiny13. My problem is that it has huge size constraints. Well, when making my first Hello World program, it took 100 bytes of program space just to make a light ...
9
votes
5answers
2k views

PIC 16F beginner.. difference in program-syntax when using different compilers

As I mentioned, I have just beginned programming pic16f877a. I can now work with 7 segment displays. At present I am using ccs compiler. Nothing wrong with that. But i prefer to be a compiler ...
9
votes
8answers
11k views

Best way to install arm-elf-gcc onto a Linux machine

Hey folks, I'm working on a device using arm-elf-gcc to compile code for a MakingThings prototype board. My development machine is a Linux box running Ubuntu 9.10. On a different linux box using ...
8
votes
5answers
7k views

What do I need to put my code onto a microcontroller?

I learned about coding a controller, but never actually put the code on the physical device. I am trying to figure out what I need to order to start developing a basic embedded system. For example, ...
8
votes
3answers
1k views

What does #if 0 do

Today I started to use MPLAB X to program my PICs, and found a code template, with multiple files and spots to fill in code. Before I have had a single file with my code in it. In this template, where ...
8
votes
1answer
4k views

How does the call stack operated during an interrupt on AVR?

(Specific to the Arduino Uno...) What happens to the stack when an interrupt occurs on an AVR microcontroller and I call a function? Does the compiler inline the code? Does it cache the stack ...
8
votes
5answers
3k views

Editable PIC Serial Number in HEX File

Currently I have a serial number hard-coded in my firmware for a design I'm working with. The firmware can read and report back the serial number. That works fine for what I need. The trouble is ...
8
votes
3answers
6k views

Absolute address of a function in Microchip XC16

Device: dsPIC33FJ128GP802 I have some *.s files as follows ...
7
votes
4answers
17k views

Toolchains for STM32CubeMX IDE: what to choose from?

I just installed the STM32CubeMX (original ST Microelectronics's ARM IDE if I understand right). Once installed I tried to open a new project for a DISCOVERY kit I have (STM32F0DISCOVERY). Howether ...
7
votes
2answers
17k views

How different is the Arduino language than Atmel Studio language? [closed]

I see that on the official Arduino website, the reference page contains the functions and vales you would use specified to the Arduino compiler. http://arduino.cc/en/Reference/HomePage What would ...
6
votes
5answers
1k views

Is there a development system for the MSP430F series microcontrollers?

I'm hoping for an IDE of some kind, but I'll take any compiler or assembler! Can't seem to find anything by googling.
6
votes
5answers
6k views

Integer to ASCII in C18

I'm writing code for a PIC18F46K22 using the C18 compiler. I want to write the value of an integer \$n\$ in ASCII over the USART to my PC. For \$n<10\$, it's easy: ...
6
votes
3answers
3k views

Usage of the #pragma pack(1) compiler directive on embedded applications

I have recently come across this #pragma pack(1) preprocessor directive and was wondering why it is being used? I Googled the usage, and found it has other options such as push,pop etc. Has anyone ...
6
votes
3answers
772 views

ARM Programming interface and tool chain

I have acquired a RM48L952 that is an ARM Cortex R4F from TI and I would like to start learning ARM development with this chip. My question is can I use any JTAG programmer to program it? Something ...
6
votes
1answer
711 views

Texas Instruments Compiler

I am working with TI's CC2533 SoC Low Power RF I bought a few chips and assembled a few PCBs.. Using TI's debugger I confirmed that I can send and receive packets using the basic RF using the ...
5
votes
2answers
1k views

If YOU were starting out now, what PIC16F-compatible IDE and compiler would you choose, and why?

This is going to be a bit long as I wanted to cover all the obvious questions before they arise, give a rationale to some of my thinking, and prove I've done my groundwork! If time is short, skip down ...
5
votes
1answer
621 views

Easiest way to get rid of __clz_tab in winavr compiled code?

I've ported a program from the arduino environment to a makefile build using winavr, which, in turn, is based on avr-gcc (just like arduino). However, my program started crashing, and after some ...
5
votes
2answers
4k views

Codevision AVR C and Atmel AVR C compiler

What is the difference between Codevision AVR C and Atmel AVR C compiler?
4
votes
6answers
2k views

Order of operations and rounding for microcontrollers

I was working on a project where I read a value from a 16-bit ADC and scaled it to obtain the reading of a sensor. For example: ...
4
votes
4answers
3k views

What PIC24 C compilers are out there, and what is your opinion or review on them?

Specifically, the PIC24 series. I tried out microchips C30 compiler, but it seems to be a bit too complicated for me, and I couldn't find any libraries with it. Then I tried CCS, and it seems far ...
4
votes
3answers
5k views

Why IAR Compiler?

I just saw an Application Note from Atmel about how to compile some code in IAR and I wonder, why would anyone use an external compiler if Atmel already provides the Atmel Studio, with a Visual Studio ...
4
votes
1answer
234 views

Moving brute-force search to FPGA

I am currently working on a scientific hobby project about computing the error detection capabilities of CRCs. Unfortunately the C++ code used for such computations has up to years of run time on ...
4
votes
1answer
2k views

Using XC8 compiler instead CCS [closed]

I'm programming PIC with CCS. It's quite simple and functional. It's libraries are the best. Recently, I look for XC8 compiler, from Microchip. What are the advantages of using XC8 instead CCS?
3
votes
5answers
2k views

Help fix or ignore aliasing warning in gcc

I'm having a problem working with the TI/Stellaris EK-LM3S6965 demo board and associated software, specifically the OLED display driver. My problem is not that it doesn't work, it's that it mostly ...
3
votes
2answers
2k views

How to solve Keil compiler 'Error: L6218E: Undefined symbol' on STM32

I am trying to run a simple tutorial (external interrupt example) on my NUCLEO-F746ZG board. I use STM32CubeMx software version 5.2.0 and Keil software version 5.28.0.0 as compiler. I get the ...
3
votes
4answers
2k views

How can we determine memory usage of a microcontroller

How can we determine how much memory is being used, or will be used by firmware in a microcontroller? What tools can support this? Generally we don't use dynamic memory in embedded systems, but how ...
3
votes
3answers
965 views

Exact recreation of Xilinx FPGA binaries from source control

I'm software developer in a small shop where there's only been one EE guy responsible for a series of FPGA designs spanning a decade, almost all of which target the Spartan line, specifically the ...
3
votes
2answers
4k views

Memory management problems with ATTiny85

The setup is as follows: I have a little program to drive single color 8x8 led matrix using 595 shift registers that are supplied with data by ATTiny85 through USI as SPI Master. I upload program to ...
3
votes
2answers
3k views

Makefile for STM32

I want to write code in just a text editor (not an IDE) and then build it with a simple Makefile. I've got: small STM32F103 board ST-Link/V2 SWD programmer gcc-arm-none-eabi toolchain stlink ...
3
votes
1answer
190 views

AVR bit manipulation compilation in GCC: can not get SEI instead of read-modify-write

I'm trying to set bit 2 in TIMSK register and using the following C code: TIMSK |= (1<<2); Compiler makes the following code: ...
3
votes
1answer
201 views

Integers >9999 in PIC C18

In this answer, I made a function to convert an integer to an ASCII string: ...
3
votes
1answer
7k views

How does the Arduino IDE/build system work?

How does the Arduino IDE/build system work? I noticed that they use the avr-gcc in the background, but what do they do on top? They seem to have their own "kind of C" language that transforms into ...
3
votes
2answers
2k views

Watchdog reset using C32 v2.00 compiler

Compiling an existing PIC32 project using the v2.00 C compiler produces a continual watchdog reset. This problem does not appear using the previous v1.12 compiler. Changing the watchdog postscaler ...
3
votes
3answers
719 views

Frequently used functions, performance improvements using static variables?

Does defining variables (large arrays) as static inside a function have any performance improvements if the function is to be called repeatedly say in the order of seconds?
3
votes
3answers
2k views

Can I pass a bit register as a function argument in Hi-Tech C compiler for PIC16?

Is there a way to pass a bit from a PIC's register as a function parameter? Taking, for example, the PIC16F887, its registers (SFRs) and individual bits are defined as fallows in the corresponding ...
3
votes
1answer
1k views

How to include paths for the C compiler in atmel studio?

I have a folder project and it consists of multiple folder and .c and .h files what is the best way to include them all without including the individual folders?
3
votes
1answer
1k views

Execution time problem of Memset() function in C

I have a typedef struct that stores my cumulative ADC parameters. When I clear my ADC_Sum struct it takes less than 300 ns to achieve the clearing process between size 1-8. But when size is ...
3
votes
0answers
518 views

dsPIC: Link assembler project with XC16 in command line mode

I have an assembler project that compiles and links fine with MPLABX. Now I am trying to build it from the command line. Attempt to use the command line from MPLABX fails. When I am calling: C:\...
3
votes
2answers
3k views

STM32 ARM header files for use with Eclipse and GCC

I'm a mechatronics (mechanical and electrical) engineering student and want to learn how to program ARM microprocessors. I've used Atmel ATMegas previously. I'm using a mac and being a student I don'...