problem of nandflash address in at91bootstrap

Discussion around products based on ARM Cortex-A5 core.

Moderator: nferre

leo.ni
Posts: 52
Joined: Mon Jun 06, 2016 4:20 am

problem of nandflash address in at91bootstrap

Wed Jul 13, 2016 2:40 am

Hi,all. i have a problem about nandflash address. i use sam-ba to flash my code to nandflash on sama5d3-xplained board.in bootstrap,flash address set 0x40000,but nandflash address should 0x7000000 according datasheet page 30.Am i correctly?Can someone give me some advise?Thanks a lot!
blue_z
Location: USA
Posts: 2128
Joined: Thu Apr 19, 2007 10:15 pm

Re: problem of nandflash address in at91bootstrap

Wed Jul 13, 2016 10:41 pm

leo.ni wrote:i have a problem about nandflash address.
Which seems to derive from misreading, misunderstanding, and sloppy use of terminology.
leo.ni wrote:in bootstrap,flash address set 0x40000
If you mean AT91Bootstrap, then use its proper name instead of referring to a generic program.
To which "flash address" are you referring?
Are you referring to a configuration step for building AT91Bootstrap, or something in the just mentioned SAM-BA utility?
leo.ni wrote:,but nandflash address should 0x7000000 according datasheet page 30.
To what are you referring by "nandflash address"?
What datasheet?
Reference a table or section for clarity.
If you mean the SAMA5D3 datasheet, then there is no "nandflash address" or "0x7000000" mentioned in that Figure 5-1 memory map.
There is a NFC (NAND Flash Controller) that starts at 0x70000000.

And this is a memory map for the SoC, which is a completely different address space from the NAND chip's address space.
leo.ni wrote:Am i correctly?
No, you are not correct.

Regards
leo.ni
Posts: 52
Joined: Mon Jun 06, 2016 4:20 am

Re: problem of nandflash address in at91bootstrap

Thu Jul 14, 2016 3:22 am

Thanks! i run at91bootstrap on sama5d3-xplained board. i used sam-ba to flash my code to nandflash on my board(sam-ba setting as attachment).The address in sam-ba is 0x40000,but in sama5d3 datasheet figure5-1,nandflash address is 0x60000000,nfc controller address is 0x70000000.why the address in sam-ba setting is 0x40000?
Attachments
sam-ba_0714.png
sam-ba_0714.png (2.05 KiB) Viewed 19294 times
blue_z
Location: USA
Posts: 2128
Joined: Thu Apr 19, 2007 10:15 pm

Re: problem of nandflash address in at91bootstrap

Thu Jul 14, 2016 5:03 am

leo.ni wrote:The address in sam-ba is 0x40000,but in sama5d3 datasheet figure5-1,nandflash address is 0x60000000,nfc controller address is 0x70000000.
You persist in mentioning addresses without regard to their purpose.
How much of my previous post did you actually read and understand?

Do you understand the concept of disjoint address spaces?

Adul lives at 101 Main Street.
Ivan lives at 707 Broadway Avenue.
So you figure you can visit Maria at either 707 Main Street or 101 Broadway Ave!
Does that make any sense?
You cannot take the numeric address from one address space, and expect to use it meaningfully in a different address space.
leo.ni wrote:why the address in sam-ba setting is 0x40000?
I rarely use SAM-BA, so I don't know.
Is that the default value when the program starts up?

The salient section to read in the SoC datasheet is Boot Strategies.
The second-stage bootloader (i.e. AT91Bootstrap) is read from NAND address 0x0.
Actually the source address is 0xD0 to account for the PMECC header, but that is automatically installed by SAM-BA so long as you use the special Send Boot File command.

Regards
leo.ni
Posts: 52
Joined: Mon Jun 06, 2016 4:20 am

Re: problem of nandflash address in at91bootstrap

Fri Jul 15, 2016 9:38 am

Thanks!iI think i understand what you mean.0x40000 is the address that i set by myself, it is the address that belongs to nandflash.0x60000000 is the address that belongs to sama5d3. Am i correct? if i want to store my data to this nandflash, example, i want to write my data to 0x80000,can i do this directly?
blue_z
Location: USA
Posts: 2128
Joined: Thu Apr 19, 2007 10:15 pm

Re: problem of nandflash address in at91bootstrap

Fri Jul 15, 2016 9:22 pm

leo.ni wrote:0x40000 is the address that i set by myself, it is the address that belongs to nandflash.0x60000000 is the address that belongs to sama5d3. Am i correct?
No.
The numeric address does not "belong" to an address space.
It is the object that has an address in a specific address space.
You cannot reference that object by using its address in a different address space.

In this entire thread, you tend to specify only 2 out of 3 attributes at any given time. Sometimes you ignore the address space; other times you ignore the object of the address.
You seem to treat the numeric address as if it had intrinsic attributes, but it's just a number so it does not.
If you do not ascribe any attributes to a numeric address, then you're just talking nonsense.
leo.ni wrote:if i want to store my data to this nandflash, example, i want to write my data to 0x80000,can i do this directly?
You have to install AT91Bootstrap at NAND address 0x0. (object=AT91Bootstrap, addr_space=NAND, addr=0x0).

Regards
leo.ni
Posts: 52
Joined: Mon Jun 06, 2016 4:20 am

Re: problem of nandflash address in at91bootstrap

Mon Jul 18, 2016 3:38 am

Thanks a lot! i will think it over again. if after using at91bootstrap to boot my program,do i need to initialize SMC in my code again? i didn't find the initialization code about SMC in at91bootstrap.Thank you very much again!
blue_z
Location: USA
Posts: 2128
Joined: Thu Apr 19, 2007 10:15 pm

Re: problem of nandflash address in at91bootstrap

Tue Jul 19, 2016 12:53 am

leo.ni wrote:if after using at91bootstrap to boot my program,do i need to initialize SMC in my code again? i didn't find the initialization code about SMC in at91bootstrap.
Illogical question. The RomBoot must have (minimally) initialized the SMC and NFC in order to load AT91Bootstrap from NAND.
What would have reset that (prior) initialization after AT91Bootstrap has loaded its target?

The boot code is typically only going to initialize what is required to accomplish the boot operation (U-Boot is an exception because of its name).
There are often other devices that are not essential to booting that later stages of code must initialize.

If you're not sure what needs to be initialized, then try reading appropriate device registers.

Regards
leo.ni
Posts: 52
Joined: Mon Jun 06, 2016 4:20 am

Re: problem of nandflash address in at91bootstrap

Tue Jul 19, 2016 8:06 am

Thanks! i can operate nandflash using "SkipBlockNandFlash" interface that providing in nandflash library now. But i have two questions:
1:why define pins for nfc whit zero?

Code: Select all

/** Nandflash chip enable pin.*/
static const Pin nfCePin = {0, 0, 0, 0, 0};
/** Nandflash ready/busy pin.*/
static const Pin nfRbPin = {0, 0, 0, 0, 0};
2、if i backup my firmware to another region using different parameter(example pmec),can at91bootstrap boot it normally?

Thans you very much again!
blue_z
Location: USA
Posts: 2128
Joined: Thu Apr 19, 2007 10:15 pm

Re: problem of nandflash address in at91bootstrap

Thu Jul 21, 2016 1:18 am

leo.ni wrote:1:why define pins for nfc whit zero?

Code: Select all

/** Nandflash chip enable pin.*/
static const Pin nfCePin = {0, 0, 0, 0, 0};
/** Nandflash ready/busy pin.*/
static const Pin nfRbPin = {0, 0, 0, 0, 0};
You're only looking at the initialization for program start.
You have to review the code to see how those arrays are used.
leo.ni wrote:2、if i backup my firmware to another region using different parameter(example pmec),can at91bootstrap boot it normally?
AT91Bootstrap is a single-purpose program. You could configure/modify it to do whatever, so long as you realize that it is dedicated to just one purpose.
If you want an interactive bootloader and/or a bootloader that can be configured using environment variables or run scripts, then have AT91Bootstrap load U-Boot, which can then load whatever from where-ever.

Regards
leo.ni
Posts: 52
Joined: Mon Jun 06, 2016 4:20 am

Re: problem of nandflash address in at91bootstrap

Thu Jul 21, 2016 3:40 am

Hi,blue_z,Thank you very much for your help! i resolved the second question, i can backup my firmware via analyzing at91bootstrap code now.But the first question is still bothering me, i look for the sample code and attemt to find any things about those pins,but nothing found. Can you expain detail? Thanks!
blue_z
Location: USA
Posts: 2128
Joined: Thu Apr 19, 2007 10:15 pm

Re: problem of nandflash address in at91bootstrap

Fri Jul 22, 2016 1:01 am

leo.ni wrote:1:why define pins for nfc whit zero?

Code: Select all

/** Nandflash chip enable pin.*/
static const Pin nfCePin = {0, 0, 0, 0, 0};
/** Nandflash ready/busy pin.*/
static const Pin nfRbPin = {0, 0, 0, 0, 0};
As far as I can tell, you would only use these pin definitions if your board connected the NAND flash's CE and BUSY to GPIO pins instead of the standard EBI pins.
Since the Xplained board does use the EBI connections (to the NFC), these two pins are zeroed out to indicate that they are not used.

Regards
leo.ni
Posts: 52
Joined: Mon Jun 06, 2016 4:20 am

Re: problem of nandflash address in at91bootstrap

Fri Jul 22, 2016 10:03 am

Thank for your help! i will think it over continue. Thanks again!

Return to “SAMA5D Cortex-A5 MPU”

Who is online

Users browsing this forum: No registered users and 2 guests