ARM9 MC9328MX21 CPU programming.

Hi guys.

I have built a test ARM9 board with the MC9328MX21 Processor.

How can i load a uboot or a similar software to it, in general how do i program it?

I want to load uMon on it and a Linux jffs2 image.

How do i do that?

I have the simple JTAG Programmer/Debugger for ARM processors

will i be able to program with it ?

Please help out here.

Hi mc9328mx21 has a simple bootrom(booting from uart/usb as an alternative to flash) inside the soc which you can use to program any bootloader you want or directly the kernel/filesystem images from your pc’s usb or com port. Refer to chapter 9 of the reference manual. I assume that you have put a dip switch or pullup pulldown resistors on the BOOT[2:0] pins so you can select usb/uart boot or flash boot.Freescale also have put up a sample windows based programming application for nor flash with a customizable bootloader.

http://www.freescale.com/files/32bit/so … zip?fpsp=1

.You could still use a wiggler compatible jtag device to program flash . You will have to modify jtag tools slightly. Considering the extra effort for this , it is probably better to use the in built bootloader and use jtag only for debugging.

i tried to upload the bootloader from the HUB application (with the bootloader)

but i think i messed up the internal bootloader of the iMX21. I accidently switched the boot pins while the processor was operating.

Since then i was unable to load anything to the processor.

Could i of damaged the processor?

Is there a sure way of loading a test loader onto the processor to check it?

I have set up the Openocd for wiggler, so i just have to upload something to it. is this correct?

is there a sure way of testing if the iMX21 works correctly on my board ?

I understand that i have to first initialize the SDram, enable I-Cache and the PLL Clock settings.

Well, i have done that, all except the last one.

I have problems enabling the PLL, i have set up the registers for what i need it to work but when i go and RESET the MPLL bit then i.mx21 reboots and all my setup is reset to default settings.

I have a 32.7… Crystal on the processor with 2 22pf capacitors to GND. Should the processor do what i just described or there is a problem here.

If so then please advise on what could be the problem.

fgcity:
Hi guys.

I have built a test ARM9 board with the MC9328MX21 Processor.

How did you deal with the BGA package of the MCU? Care to share your board schematic?

8-Dale

Same question :wink: how did you solder a BGA like that?

the PCB was designed by me and then sent to manufacturing, so it’s a 4 layer PCB with 4 mil spacing.

so how about my question?

could you please help me out here?

the soldering was done with a hot air soldering

fgcity:
the PCB was designed by me and then sent to manufacturing, so it’s a 4 layer PCB with 4 mil spacing.

I don't have an answer to your question, but I am very interested in the design of your i.MX21 board. Can you share the schematics, and board design?

I would help you if I had answers to your questions.

8-Dale

the main design i took from the ADS Development board from Freescale.

I just ported the processor for different RAM and FLASH, plu removed all the unnessesary pins, bootstrap settings and only left the crytical things.

Actually it pretty similar to VIrtual COG so it’s something in between the ADS development and Virtual COG with some extra LCD connectors, Bluetooth and GSM,GPS modules. I designed it to play with it as an embeded device. I even have the enclosures designed and ready to manufacture, (It’s pretty neat, almost looks like i-Phone) :slight_smile:

I designed it with the same RAM and FLASH as Virtual COG to avoid Redeveloping the bootloader and some other crytical software (it’s all pretty much the same anyway) for ARM that is.

i don’t have the schematics here (i am at home) but if you want them that bad i could send them.

I am doing my design with Altium Designer so that’s the format i can supply, but i don’t know about the Footprints and lots of custom components i designed for the library.

But meanwhile please if anyone could explain to me in few words the process of configuring the processor correctly (just in case i missed something) and porting a bootloader on it.

I managed to load a test bootloader on the device using the Bootstrap Bootloader but if i can’t get the PLL to work it won’t work in any case so please help me out here.

give me your E-mail LinuxGuy and i’ll send you a PDF copy of the schematics when i go to the office again

Why are you rolling out your own bootloader?Are you not using the default NOR / SDRAM combination connected to the same chip selects as in the ADS?

If so you are better off customising files in Nor flash Bootstrap.zip in the HAB toolkit , they are easy to modify c files. I think actually that you may have a hardware problem , and either your pcb layout or components selection or soldering could be faulty. Try increasing the PLL values in MPLL and SPLL incrementally and test it out, noting down the frequency at which your prcessor resets.If you have a good oscilloscope , you could measure the output of the CLK0 pin or a PWM/timer pin and see if indeed you are getting the frequency you expect.If you have used USB to bootload though , chances of such a problem are low and then maybe its a software problem. As a last resort, consider replacing the processor on board if you have a bga rework station.

i replaced the processor a couple of times but it’s not that, and using OpenOCD i have tested different frequencies. Still OpenOCD disconnects as soon as i reset the MPLL.

Hmm post your sequence of register assignments.

#Disable Watchdog

mww 0x10002000 0x0000

#init PLL

mww 0x10027000 0x1F18060F

mww 0x10027004 0x007B1C73

mww 0x10027000 0x1F38060F

#init SDRAM

mww 0x10000000 0x00040304

mww 0x10020000 0x00000000

mww 0x10000004 0xFFFBFCFB

mww 0x10020004 0xFFFFFFFF

mww 0xDF000000 0x8212c339

mww 0xC0200000 0x00000000

mww 0xDF000000 0xA212c339

mww 0xC0000000 0x00000000

mww 0xC0000000 0x00000000

mww 0xC0000000 0x00000000

mww 0xC0000000 0x00000000

mww 0xC0000000 0x00000000

mww 0xC0000000 0x00000000

mww 0xC0000000 0x00000000

mww 0xC0000000 0x00000000

mww 0xDF000000 0xB212c339

mww 0xC0119800 0x00000000

mww 0xDF000000 0x8212C339

#init I cache

arm926ejs cp15 0 0 1 0 0x51078

arm926ejs cp15 0 0 7 5 0

#arm7_9 fast_memory_access enable

#arm7_9 force_hw_bkpts enable # program resides in flash

arm7_9 dcc_downloads enable

If i doo all the rest and then have the MPLL in the end still i get the OpenOCD to disconnect from the processor.

Hi,

I am using some custom boards we have designed like fgcity, which have MX21 as main processor.

I have some trouble in order to make it work as fast as it should, and I don’t know if I am programming low level code in a wrong way or something.

Where did you find information on how to activate I cache? Because in the reference manual it does not appear.

In a freescale service request I was told in the worst case I can make instructions execute at 8 MHz at worst case but if I make the HCLK be 266 MHz, the CPU gets hung up somehow. Hardware is still working but it stops executing the code… then if I make the HCLK be 133 MHz it works fine, but I can’t be faster than about 6 MHz executing the code, and I don’t know if the instruction cache is working or not…

I also try to use the 26 MHz oscillator but CPU continues using the 32 KHz XTAL… any ideas about any of this?

Thanks in advance

Albert

the info on how to activate the cache and other stuff i found through the Datasheet.

If you read it long enough you get it memorized and actually understand what I-Cache Means.

About the other stuff i can’t help you here since as you can see i am having the same problem. (well almost the same) :slight_smile: