By default, Eclipse provides ‘stop-mode-debugging’: in order to inspect the target code and data, I have to stop the target. But with the right extensions as present in the Eclipse based MCUXpresso IDE, it is possible to inspect the target even while it is running.
Tag Archives: global variables
McuOnEclipse Components: 22-Mar-2015 Release
There is a new release of the McuOnEclipse components available on SourceForge, with the following main changes:
- Shell: Fixed and improved history handling.
- MinIni: Option to select local/stack or global memory for buffers
- FreeRTOS: Ability to use the tick counter instead of dedicated timer for performance measurement.
- FSL_USB_Stack: Added deinitialization for USB stack.
- FatFsMemSDHC: added custom card detection and write protection pin handling.
- Multiple Bug Fixes
C++ with Kinetis Design Studio
Unlike CodeWarrior, the Kinetis Design Studio (at least in V1.1.1) does not offer a choice between C and C++ projects. That makes sense with the GNU ARM Eclipse plugins, other than the CodeWarrior gcc integration, there is no need for setting up a special tool chain for C++ (see “Compiling C Files with GNU ARM G++“). While this is great, things are not perfect yet, so I’m providing in this post the information needed to properly setup a C++ project with Kinetis Design Studio V1.1.1.
Tutorial: PWM with DMA on ARM/Kinetis
For a project I need to change the PWM duty cycle after a PWM period is over. One way to do this is to have an interrupt at the end of the PWM period, and then set the new PWM duty (compare) register value in the interrupt. That works fine for ‘slow’ PWM frequencies, but if the PWM frequency is high, the CPU load is massively increasing. A better way is to use DMA (Direct Memory Access).
GNU Linker, can you NOT Initialize my Variable?
my students sometimes are afraid to ask questions, although I urge them ask any question. In my opinion there are no ‘dumb’ questions: only questioning things let us think and learn new things. I see that many readers of this blog are *not* afraid to comment or ask questions. The WordPress statistics shows 5’687 questions/comments for this blog (thank you all!), and the spam filter protected me from 202,341 items (ok, these *are* dumb) :-).
The ‘question of the week’ comes from Andy. That question caused me some serious head scratching, but the same time I have learned something important and useful for my next project: how to tell the ARM GNU linker *not* to initialize variables?
Variable Debugging with Eclipse Kepler
The current Eclipse Kepler version comes with changes for debugging variables. I have students coming from the earlier Eclipse versions, so here are a few tips for dealing with variables in Eclipse Kepler.
EnterCritical() and ExitCritical(): Why Things are Failing Badly
I have carefully implemented my firmware. It works perfectly for hours, days, months, maybe for years. If there would not be this problem: the firmware crashes sporadically :-(. Yes, I’m using watchdogs to recover, but hey: it is a serious problem. And because it happens only under rare and special conditions, it is hard to track it down or to debug it.
The thing is: these nightmares exist, and they are real and nasty. I’m pushing my students hard on this topic: It is about how to protect critical sections. And what could go wrong. And here is just yet another example: how it can go badly wrong if you are not careful. And it took me a while too to realize where the problem is. It was not a fun ride….
“Volatile” can be harmful…
What could be wrong with this code:
volatile uint16_t myDelay; void wait(uint16_t time) { myDelay = 0; while (myDelay<time) { /* wait .... */ } } void TimerInterrupt(void) { myDelay++; }?
FreeRTOS Heap with Segmented Kinetis K SRAM
While working on a project for the FRDM-K20D50M, I faced a problem: I was running out of SRAM for my application. The GNU linker reports: “section `.bss’ will not fit in region `m_data'”: 😦
But my device has 16 KByte of SRAM, and I knew I use much less than 10 KByte. So what is the problem? Continue reading
text, data and bss: Code and Data Size Explained
In “Code Size Information with gcc for ARM/Kinetis” I use an option in the ARM gcc tool chain for Eclipse to show me the code size:
  text     data      bss      dec      hex   filename  0x1408     0x18    0x81c     7228     1c3c   size.elf
I have been asked by a reader of this blog what these item numbers really mean. Especially: what the heck is ‘bss’???? 🙂