Hello,
Does anybody know if I can use the Keil MDK to write baremetal code for the Raspberry Pi?
Thanks.
The keil MDK-ARM kit is designed for smaller microcontrollers.
Any reason you don't want to use the free gcc toolchain for the RP? What advantages do you see with trying to use MDK-ARM? The Keil tools requiers a commercial license, since it isn't meaningful to use the demo version on a RP because of the restrictions in code size.
Hi,
I only want to write small baremetal applications so the Lite version would be great. I want to learn about other development environments.
But the lite edition is still a commercial license that costs money. Just a bit less money than the larger license options.
The completely "free" demo version has extremely limited code size so it is probably not meaningful to use - it is only intended to test the tool and get an idea what the tool can do.
In your case, you will already be able to find complete configuration files for how to build binaries for use on the Raspberry Pi. Running a "bare metal" application on the platform is very similar to compiling the Linux kernel. Your code would be started in the same way that the Linux kernel gets started. Which also means that you can look at the Linux kernel source to see what they do to activate different hardware functions of the processor.
Sorry sir, but I think you are wrong. The Lite version is the same as the demo version. I know it is limited but it is also free. I can make an application up to 32K which I think is plenty for a small baremetal application. Also a baremetal application is not like the Linux kernel. It is more like a bootloader. I want to learn about bootloaders and I want to talk to the chip directly.
I think that the debugger and stuff will not be able to simulate the Broadcom chip, but I want to make simple assembly and C applications and try them. I think that the Keil MDK can produce code to work with the Broadcom core.
The Linux kernel can be run "raw" or you can have a boot loader that starts it. It's just that it is normally easier to have a boot loader start the kernel since a boot loader represents a much easier solution to switch to another Linux kernel version.
You can even find variants where people have thrown out the BIOS from a PC and booting Linux directly from the BIOS flash memory.
Sir,
Sorry but I do not understand why you keep talking about using the kernel and the PC. I know what the kernel does but I do not want to do that at the moment. I want to do baremetal with my Raspberry Pi. To talk directly to the hardware with only a little code. I have found a lot of example code using GCC but I want to learn about using another development environment.
Not sure why Per would want to stop you from experimenting.
Keil isn't particularly well situated for the Raspberry Pi development work, it doesn't seem to have native support for Broadcom CPUs, good hardware/register level documentation for Broadcom or Marvell parts is not at all easy to obtain.
Do you have good JTAG/SWD connectivity to permit low level development?
Most available example source for the platform is likely to target GNU/GCC tools.
"Not sure why Per would want to stop you from experimenting."
There isn't one single sentence in my posts where I want to stop him from experimenting. All I am questioning is his interest in using the Keil tools, instead of gcc. Do _you_ see any obvious advantage to use the Keil tools instead of gcc?
Do _you_ see any difference in me noting more samples to look at if using gcc, compared to your own suggestion that there are more samples to look at if selecting gcc?
View all questions in Keil forum