We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
Does anybody know if I can use the Keil MDK to write baremetal code for the Raspberry Pi?
Thanks.
Yes, I have used the word "kernel" in several posts. But only one post noting kernel+PC.
And in none of the posts have I said you should use a Linux kernel. I just noted that the Linux kernel can be used bare metal, which means it could be interesting to take a closer look at how that was done - and to take a peek at the kernel code for how to set up some of the hardware your own bare-metal code would also need to configure.
Don't know what bare metal is? Well, how could I not, since I have worked with embedded for a huge many years - including writing boot loaders? In fact, a huge majority of all embedded devices only have bare bone, or requires the developer to both write a boot loader and the actual application just to give the customer a way to field-update the firmware.
"But I already know that! I know all code starts at the beginning."
That is a sentence that just doesn't make sense. All code may have an entry point, and so it would be irrelevant to spend time talking about it unless you have specific issues with that. What I am talking about is the hardware setup that a bare-metal program needs to worry about - like all the oscillator settings, power configurations, memory mappings etc. Not sure if you have thought about it, but lots of low-level information are often not (!) available in a document _you_ can get access to. Which is a reason why it might be meaningful to look at the Linux kernel source to see the data structures, the register values etc.
You say you have little money. In which case gcc have advantages. The Keil tools aren't intended for the processor in the Raspberry Pi.
You may think you asked a simple question. Just don't lock yourself into believing you know what the correct answer is to that question. If you have already decided that the answer is Keil, then there wouldn't have been a need for a question in the first place, would it?
"Why do you have to give your opinion about whether it is a good idea?"
Because that follows directly from your question. You ask if you can use the Keil tools? You might be able to. But they aren't designed for that specific task - the Raspberry Pi processor is not in the list of supported processors. So a good answer then would be to tell you that the Keil tools would most probably not be a good idea to use.