Programming AT91SAM9N12 without external memory

Discussion around AT91RM9200 and SAM9 Series Products.

Moderator: nferre

wesperos
Posts: 8
Joined: Sun Jan 15, 2017 3:37 pm

Programming AT91SAM9N12 without external memory

Sun Jan 15, 2017 3:46 pm

Hello folks, AT91 beginner here.

I've just finished my PCB with 217 BGA chip AT91sam9n12 pinout board. I didn't put any memories around it - it's just MPU, power supply and GPIO pins. It's an old model but I wanted to learn it anyway, for the sake of learning only.


It seems that soldering worked fine as it turns on when I plug it in and SAM-BA can connect to it. However, I want to practice programing and I see it has 32kB SRAM and 128kB ROM internally. Is it possible to put some program there, like UART or something else, using SAM-BA? All online docs I've found are either about booting Linux or executing applets, and I would like pure stand alone chip, just to learn to work with its registers.

Cheers,

W.
blue_z
Location: USA
Posts: 1504
Joined: Thu Apr 19, 2007 10:15 pm

Re: Programming AT91SAM9N12 without external memory

Tue Jan 17, 2017 12:27 am

wesperos wrote:... I see it has 32kB SRAM and 128kB ROM internally. Is it possible to put some program there, like UART or something else, using SAM-BA?.
ROM is Read Only Memory, meaning you cannot write to it.
The contents of a ROM is masked into the silicon at time of fabrication.
This ROM is also secured, meaning you cannot even read its contents (proprietary Atmel boot code and SAM-BA Monitor program), it can only be executed.

You can use the SRAM for code, data, and stack. You'll probably have to use 16-bit Thumb instruction instead of standard 32-bit ARM instructions. Assembly language would be more compact than C.

IIRC only a few SAM-BA applets execute out of SRAM (e.g. the DRAM initialization). Most SAM-BA applets execute out of (external) DRAM. So you'll have to write your own applets.

Look at the Makefile of AT91Bootstrap (which executes out of SRAM). It has a ChkFileSize function to confirm that the new binary is small enough to fit into the SRAM.

You should study the "Boot Strategies" chapter in the datasheet, especially the SAM-BA Monitor section, to understand how the SAM-BA host program works, or simply begin accessing device registers.
If you have the time and skill, it could be possible to write a new host program and target applets that utilize program chaining or overlays, old techniques used when memory is limited.

Regards
wesperos
Posts: 8
Joined: Sun Jan 15, 2017 3:37 pm

Re: Programming AT91SAM9N12 without external memory

Wed Jan 18, 2017 12:31 pm

Hey, thanks for the answer.. it seems that writing my own host program is way out of my league so I switched to the standard proceduere: uploading bin files to the external Flash.

Return to “SAM9 ARM9 MPU”

Who is online

Users browsing this forum: No registered users and 3 guests