ARM Memory Map & Keil Questions

Everything ARM and LPC

Moderator: phalanx

Post Reply
wcarl
Posts: 1
Joined: Tue Apr 28, 2015 9:34 am

ARM Memory Map & Keil Questions

Post by wcarl » Tue Apr 28, 2015 10:04 am

So I have quite a bit of experience writing software for Windows (C# and .NET, got an internship while in high school) and a few years ago started writing C code for Atmel and PIC chips while in school for an EE degree. That was a relatively easy transition to wrap my head around.

Now I recently started trying to get into the ARM world and I have had nothing but struggles so far. Maybe I am looking in the wrong places for help but I have spent hours upon hours searching the internet, reading PDFs, reading blogs, reading ARM documentation and while I understand some things I still feel like my knowledge is insufficient to be productive. Is this just me being unrealistic and trying to learn too much at once, is ARM and all the supporting tools (Keil and all of it's features and quirks) too much for one person to learn as a side hobby? It may be that it's just too much or maybe like I said I'm looking in the wrong places. Or maybe I am in the right direction and it just takes significantly more time to learn.

It just all seems significantly more convoluted than Atmel for instance. The fact that you have to use CMSIS (which I don't even really understand the place of), all the stuff about memory maps, scatter files, startup files, SystemInit(). Atmel was just a single header file with all the register definitions, however many C files you needed/wanted. But now there is all of this code being written for you and I hate it because I don't know what any of the code that Keil wrote under hood is doing. I want to understand it but every time I look at the startup file etc. and try and lookup what the instructions mean I get thoroughly lost. I kind of understand what I see but ultimately I could not reproduce it and that bothers me as like I said I want to know how the stuff works not just accept that it works.

I specifically titled this post "memory map and keil questions" cause my most current road block is trying to understand what these lines of code do.

Code: Select all

; <h> Stack Configuration
;   <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>

Stack_Size      EQU     0x00001000

                AREA    STACK, NOINIT, READWRITE, ALIGN=3
Stack_Mem       SPACE   Stack_Size
__initial_sp


; <h> Heap Configuration
;   <o>  Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>

Heap_Size       EQU     0x00000200

                AREA    HEAP, NOINIT, READWRITE, ALIGN=3
__heap_base
Heap_Mem        SPACE   Heap_Size
__heap_limit

                PRESERVE8
                THUMB
My initial research would make me inclined to think I cannot up the stack size past the largest continuous clock of SRAM which is 40kB. But if I need more than 40kB of SRAM do I need to declare new 'AREA' (whatever that is) or is the compiler smart enough to decipher this number and put the SRAM into each isolated section on its own. I couldn't find the answer online.

In general as I stated I just don't know that I feel knowledgeable enough to be using ARM. So I am looking for suggestions on how to learn all these detailed things that I feel I should know.

I would appreciate any thoughts on books or other good resources to look into. Thanks in advance!

Wes

cfb
Posts: 214
Joined: Sat Aug 30, 2008 11:50 pm
Contact:

Re: ARM Memory Map & Keil Questions

Post by cfb » Wed Apr 29, 2015 5:05 am

The 32-bit ARM microcontrollers are in a totally different league to the Atmel and PIC devices you have had experience with. You should expect there to be a steeper learning curve with the significantly more powerful, capable and complex ARM devices.

I would recommend that you start off with one of the smaller ARM Cortex-M3 systems aimed at beginners (e.g. an NXP LPC176x mbed board or LPCXpresso board). I would not recommend C if you had no previous programming experience but as you already have then you know what to expect there. You do NOT have to use CMSIS if you do not want to. The book I recommend is Joseph Yiu's "The Definitive Guide to the ARM Cortex-M3". You should also download the User Manual and Datasheet for your chosen microcontroller from the manufacturer's website.

Good Luck!
Chris Burrows
Astrobe: ARM Cortex-M3, Cortex-M4 and Xilinx FPGA Development System
http://www.astrobe.com

cfb
Posts: 214
Joined: Sat Aug 30, 2008 11:50 pm
Contact:

Re: ARM Memory Map & Keil Questions

Post by cfb » Fri May 01, 2015 5:34 pm

... I should also have mentioned Coridium's PRO-Plus and Super-PRO ARM Cortex-M3 boards. These are extremely easy to get started with.
Chris Burrows
Astrobe: ARM Cortex-M3, Cortex-M4 and Xilinx FPGA Development System
http://www.astrobe.com

stevech
Support Volunteer
Posts: 2907
Joined: Sat Jun 05, 2004 8:51 pm
Location: USA, California

Re: ARM Memory Map & Keil Questions

Post by stevech » Sun May 10, 2015 8:25 pm

@wcarl
Here's a great ARM Cortex M4 hardware, software libraries extending Arduino libraries, and a good user forum for help.
See the Teensy 3.1 and the newer Teensy LC (low cost).
http://www.pjrc.com/teensy/index.html
https://forum.pjrc.com/

Post Reply