Questions tagged [keil]

Keil IDE and compiler tools for ARM and other embedded microcontrollers. This includes: ARM Development Tools C166 Development Tools C51 Development Tools C251 Development Tools Debug Adapters Evaluation Boards

Keil IDE and compiler tools for ARM and other embedded microcontrollers.

The Keil IDE includes:

  • ARM Development Tools
  • C166 Development Tools
  • C51 Development Tools
  • C251 Development Tools
  • Debug Adapters
  • Evaluation Boards

More information is available at http://www.keil.com/

713 questions
31
votes
5 answers

How to place a variable at a given absolute address in memory (with GCC)

The RealView ARM C Compiler supports placing a variable at a given memory address using the variable attribute at(address): int var __attribute__((at(0x40001000))); var = 4; // changes the memory located at 0x40001000 Does GCC have a similar…
Bas van Dijk
  • 703
  • 1
  • 7
  • 11
26
votes
2 answers

Why didn't the compiler warn me about an empty if-statement?

I'm using Keil uVision v4.74 and have enabled the option "All Warnings". I wrote the following intentional code: if(condition matched) { //do something } When I rebuilt my project, I got 0 errors, 0 warnings. However, when I accidentally…
AlphaGoku
  • 862
  • 1
  • 7
  • 21
14
votes
5 answers

Keil vs GCC for ARM7?

How does Keil compare to GCC for ARM7 development? I'm in the process of choosing hw consultants for a medium size project and some use keil and some use gcc. I'd like to know the gotchas involved in going with either option...
c0m4
  • 4,073
  • 8
  • 32
  • 39
13
votes
4 answers

How to print unsigned char as 2-digit hex value in C?

I am trying to printout an unsigned char value as a 2-Digit hex value, but always getting the result as 4-Digit hex values, not sure what's wrong with my code. // unsigned char declaration unsigned char status = 0x00; // printing out the value…
Asad Waheed
  • 319
  • 2
  • 3
  • 10
12
votes
3 answers

ARM Cortex-M compiler differences

I'm about to develop some firmwares for Cortex-M cores on STM32 processors using C for my projects, and searching on the web I've found a lot of different compilers: Keil, IAR, Linaro, Yagarto and GNU Tools for ARM Embedded Processors. I was…
Fabio Angeletti
  • 161
  • 2
  • 8
11
votes
3 answers

Comparing uint8_t with a number

Maybe I do not understand C++ properly or is it a compiler's bug? uint8_t a = 0x00; uint8_t b = 0xFF; if( a - b == 1 ) { doNothing(); } doNothing is not called (as expected), because result of (a-b) was implicitly casted to the type of second…
Amomum
  • 5,447
  • 5
  • 27
  • 54
11
votes
2 answers

How to suppress warnings in third-party source files?

I am familiar with warning suppressing pragmas for GCC and Keil (they are different, but the usage is pretty much the same). For a third-party headers I can do something like this: #pragma push #pragma suppress warning #include "whatever.h" #pragma…
Amomum
  • 5,447
  • 5
  • 27
  • 54
11
votes
2 answers

Bootloader for Cortex M3

I am using a LPC 1768 board from mbed, (with cortex M3 cpu) and I am trying to achieve something here, mainly upgrade the user application from the SD Card, I am writing two programs, first a bootloader/nano-kernel, and a user-app (helloworld will…
batmat
  • 225
  • 1
  • 5
  • 15
10
votes
2 answers

How to determine maximum stack usage in embedded system?

When I give the Keil compiler the "--callgraph" option, it statically calculates the exact "Maximum Stack Usage" for me. Alas, today it is giving me a "Maximum Stack Usage = 284 bytes + Unknown(Functions without stacksize...)" message, along with a…
David Cary
  • 4,726
  • 6
  • 47
  • 62
9
votes
1 answer

In Keil uVision 5, how can I keep the text editor line current while stepping through the debugger?

I'm using the education/evaluation version of uVision 5. When debugging my project, the disassembly window marks the next statement that will be executed with a yellow arrow in the margin. The margin in the text editor for each line will turn green…
BrianHVB
  • 1,550
  • 10
  • 27
9
votes
2 answers

RAM, Heap, and Stack memory for an STM32 board

I am working on a project that requires at least 500 kB of memory to be used. I have an SDK with this code defining the stack and the heap and it works fine. Stack_Size EQU 0x00004000 AREA STACK, NOINIT, READWRITE,…
Dude
  • 221
  • 2
  • 3
  • 12
9
votes
4 answers

How does the linker know where is the definition of an extern function?

I read a few posts and concluded that extern tells compiler that "This function exists, but the code for it is somewhere else. Don't panic." But how does the linker know where the function is defined. My CASE:- I am working on Keil uvision 4. There…
Ankit Gupta
  • 155
  • 1
  • 6
  • 15
8
votes
5 answers

Difference between UINT32_C and uint32_t

As far as I know the suffix t in uint32_t denote type name but I wonder to know what is the C in UINT32_C and what is the differences?
Mohammad Yousefi
  • 553
  • 2
  • 7
  • 21
8
votes
2 answers

Keep comments in preprocessor i file

We want to use the preprocessor output file (.i file ) for further use, especially the comments. For that, we use the /PREPRINT (or /PP) command line switch. The problem is that the KEIL compiler (C166) deletes any comments. Q: Is it possible to…
joe
  • 7,264
  • 7
  • 45
  • 73
8
votes
3 answers

Any function instead of sprintf() in C? code size is too big after compile

I am working on developing an embedded system (Cortex M3). For sending some data from the device to the serial port (to show on a PC screen), I use some own functions using putchar() method. When I want to send integer or float, I use sprintf() in…
Django
  • 149
  • 1
  • 3
  • 9
1
2 3
47 48