cancel
Showing results for 
Search instead for 
Did you mean: 

How can I boot from Main flash?

jinguanghua
Associate II
Posted on March 02, 2004 at 11:37

How can I boot from Main flash?

5 REPLIES 5
jinguanghua
Associate II
Posted on May 17, 2011 at 11:59

Dear All:

does anyone know how to boot from ST3234A main flash?

I try to have 1. 64K flash as ROM. 2. Boot from Main flash

3. or boot from second flash, get another one page of Main flash as ROM,

what I have done:

1. define second flash address from 0 to 7FFF.

2. define main flash page 0 from 8000 to FFFF. PSEN access.

3. Main flash Page1~7, data space, actually I don't care, i don't use it.

In the code, I write:

cseg at 0000h, interrupt ISR

cseg at 0100h, start initialization

ljmp 8000h

org 8000h

mainloop:

ljmp mainloop

but the code in Main LOOp didn't run. so does anyone have any idea?

Thank in advance for your help.

Frank

jdaniel
Associate II
Posted on May 17, 2011 at 11:59

Frank,

One problem might be the way you have set the VM register at startup. In PSDSoft Express, on the initial design assistant screen (the ''Define PSD and MCU/DSP'' page), there are some settings where you can choose what address space will be used to access main and secondary flash. If you have main flash mapped to ''data space only'', then you'll need to change the VM register to allow PSEN to access this space before you execute your LJMP 8000H instruction. A better way might be to just change this setting in PSDSoft to ''program space only'' or ''program and data space.''

Also note that this is necessary even if you have specified ''_psen'' as a signal qualifier for the fs0 chip select. I believe that if you don't have the VM register set correctly, the psen signal isn't even routed to the decoder for the main flash chip selects.

Let me know if that helps.

Best Regards,

pHaze426
jinguanghua
Associate II
Posted on May 17, 2011 at 11:59

Hi, pHaze426: Thanks.

I have checked the way I set in PSDsoft, I made the new changes on the device config.

I defined MAIN FLASH as Programm space only. Second Flash as Data space only(actually I don't care the status of second flash).

in Chip Select Equation, I only defined FS0(0-7FFFF) and FS1(8000-FFFF), I left all other sectors(2 to 7) undefined. I also left Second Flash undefined.

Now I can boot up from main flash, but if I put some codes at address 8000, I LJMP to 8000H, the code doesn't run. I have checked that assembler has put the code to address 8000h, after I downloaded the hex to 3234, and then I uploaded the hex from 3234, Opened the code in ST conventional programmers, I saw that the code I expected is not put at address 8000, it followed the ISR address part.

any idea?

Thanks.

Frank

jdaniel
Associate II
Posted on May 17, 2011 at 11:59

Frank,

When you merged the psd configuration with your hex files, did you make sure to specify the correct ranges. That is, you have to set the chip selects correctly, but you also have to pick your hex file and specify 0-7FFF for FS0 and 8000-FFFF for FS1 and pick the same hex file. I suspect that what happened is you just selected it for FS0, but it won't just ''run over'' into the next segment unless you specify it there.

Best Regards,

Phaze426
jinguanghua
Associate II
Posted on May 17, 2011 at 11:59

you are right, I only let FS0 picked hex file, after I let FS1 picked the same hex file, The code runs. thanks.

Frank