Problem in Replacing AT45DB081D(1MB) Dataflash with AT45DB641E(8MB) for AT91SAM9260 Processor

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

Previously we used 1MB ( AT45DB081D ) data flash chip for our Project which is using AT91SAM9260 Processor. 

Due to code size increase, we are trying to replace the 1MB chip with 8MB chip ( AT45DB641E ) for our project.

 

In the Datasheet it is mentioned as 256/264 page size & 32768 Page number for 8MB dataflash chip. ( so we are using standard data flash size : 264 Bytes only).

 

when i add the device ( AT45DB641E ) to the existing at45Devices[] list in at45.c driver file with {32768,  1, 264,   9, 0x3C, "AT45DB641E"}, the chip is not programming correctly.

But when i change the value to {16000,  1, 264,   9, 0x3C, "AT45DB641E"}, i am able to use 4 MB of the chip. when i try to increase the value more than 16000, the program locations are changing.

 

we have properly adjusted the memory mapping for the chip ( divided memory into different sections ).. which is working fine for 1MB chip.

 

the IDE we are using for the project : IAR 5.4

we are using SAM - BA 2.12 tool to download the program into data flash.

 

we tried different approaches to access memory locations more than 16000 value. but still chip is not programming correctly.

 

when i check with Adesto Technologies, regarding the dataflash chip compatibility, they told 8MB chip is compatible with AT91SAM9260 controller.

 

what is causing the issue? please help..

 

This topic has a solution.

Pujitha Beta
KONE ELEVATORS India Pvt. Ltd.

Last Edited: Thu. Jul 30, 2020 - 07:40 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

pujithabeta wrote:
AT91SAM9260

That's not a Cortex-M - it's an ARM9.

 

Strangely, there is a forum for ARM7 - but nothing for ARM9 !

 

pujithabeta wrote:
they told 8MB chip is compatible with AT91SAM9260 controller

They would be talking at the hardware level.

 

It seems that your problem is at the software/driver level.

 

But you could ask them if they have (or know of) an updated driver ?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, Thank you for the reply.

 

Yes i checked for updated drivers, but they seems very different from existing driver files in my project.

if i touch them, the entire project will need to modify. 

 

but i compared the current drivers with new driver file content, logically no change in file, only additional functions or formatting is done on driver files. 

 

is there any other solution available? Please Help!

Pujitha Beta
KONE ELEVATORS India Pvt. Ltd.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

pujithabeta wrote:
is there any other solution available? 

Debug the drivers you've got to see what's going wrong when you try to use them for the larger chip.

 

An obvious thing to start with is that all variables related to the size of the chip are big enough to cope with the larger numbers ...

 

EDIT

 

eg,

 

pujithabeta wrote:
In the Datasheet it is mentioned as 256/264 page size & 32768 Page number for 8MB dataflash chip

Think about that number - 32768

 

when i add the device ( AT45DB641E ) to the existing at45Devices[] list in at45.c driver file with {32768,  1, 264,   9, 0x3C, "AT45DB641E"}, the chip is not programming correctly.

Again - is that number going to be valid there ... ?

 

 

But when i change the value to {16000,  1, 264,   9, 0x3C, "AT45DB641E"}, i am able to use 4 MB of the chip. when i try to increase the value more than 16000, the program locations are changing.

Again - think about the number.

 

Is the limit actually 16000 - or might it, perhaps, be 16383 ... ?

 

Think of the significance of that number ...

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Thu. Jul 16, 2020 - 04:35 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


awneil wrote:

Debug the drivers you've got to see what's going wrong when you try to use them for the larger chip.

i tried to debug about the chip information, i am able to read the data flash chip Id and configured no of pages all working fine.

 

awneil wrote:

An obvious thing to start with is that all variables related to the size of the chip are big enough to cope with the larger numbers ...

Yes, verified the size also, below adding the code for reference from at45.h file

 

static const At45Desc at45Devices[] = {

    {  512,  1, 264,   9, 0x0C, "AT45DB011D"},

    { 1024,  1, 264,   9, 0x14, "AT45DB021D"},

    { 2048,  1, 264,   9, 0x1C, "AT45DB041D"},

    { 4096,  1, 264,   9, 0x24, "AT45DB081D"},

    { 4096,  1, 528,  10, 0x2C, "AT45DB161D"},

    { 8192,  1, 528,  10, 0x34, "AT45DB321D"},

  //  { 8192,  1, 1056, 11, 0x3C, "AT45DB642D"},

    { 16000,  1, 264, 9, 0x3C, "AT45DB641E"},               /* Modified for Current 8MB dataflash */

    {16384,  1, 1056, 11, 0x10, "AT45DB1282"},

    {16384,  1, 2112, 12, 0x18, "AT45DB2562"},

    {32768,  1, 2112, 12, 0x20, "AT45DB5122"}

};

 

typedef struct {

    /// dataflash page number.

    unsigned int pageNumber;

    // indicate if power-of-2 binary page supported.

    unsigned int hasBinaryPage;

    /// dataflash page size.

    unsigned int pageSize;

    /// page offset in command.

    unsigned int pageOffset;

    /// Dataflash ID.

    unsigned char id;

    /// Identifier.

    const char *name;

} At45Desc;

 

 

awneil wrote:

Think about that number - 32768

Again - is that number going to be valid there ... ?

From the above mentioned Devices, the last device is using "32768" value only, i think from the datasheet of AT45DB641E, this number is valid only.

 

awneil wrote:

Is the limit actually 16000 - or might it, perhaps, be 16383 ... ?

No, even if i change to 16001 also, the chip is not programming properly. i too don't understood what making it to stop till that value only.

 

and we are using sam-ba 2.12 version for programming the AT91SAM9260, we added our board specific .tcl files. Initially Not able to even flash the chip, then understood that we need to change the .tcl files also, So added the chip details( Page number, page size, etc.. ) in DATAFLASH.tcl file also. 

 

for reference from Dataflash.tcl file:

        AT45DB641  {set deviceAT45(pages_number) 16000

            set deviceAT45(pages_size) 264

            set deviceAT45(page_offset) 9

            set deviceAT45(byte_mask) 0x100

            puts "-I- DataFlash AT45DB641"}

 

Again if i keep 32768 here, chip is not programming correctly, so i have to modify here also with same 16000 like in project code.

 

and i have some doubts regarding the sam ba tool:

1. really samba 2.12 version will support AT45DB641E chip flashing? 

 

2. i checked the files in the "at91sam9260-ek" folder in C:\Program Files (x86)\Atmel\sam-ba_2.12\tcl_lib. some bin files are present in it.

      -> is sam-ba using those .bin files to run and program my device?

 

ex: 

 

2. after reading the user guide from samba i understood that, these bin files source files are available in applet folder in sam-ba 2.12 software. so i have checked dataflash related source files, and found "at45.c", "at45d.c" , "at45.h", "at45d.h" are used in those applets.

      -> the contained "at45.c", "at45d.c" , "at45.h", "at45d.h" does not contain the 8MB chip AT45DB641E infromation, so according to my knowledge if the .bin files given in tcl_lib folder will not hold the information about the AT45DB641E chip. is my understanding correct? and is there any dependency is there on those .bin files on at45.c and at45.h files which is used in sam ba tool.? 

i am adding some reference i got

 

Picture: from user guide samba 2.12 from Atmel

 

Picture: from sam ba applet folder:

 

from the drivers side i have verified line by line from code point of view.

and i checked the new driver files also from Adesto, they are now modified with SPI bit banging method, which is difficult to implement in my current project with AT91SAM9260, i am parallelly verifing with Adesto also whether SPI is bit banging is compatible with the AT91SAM9260 processor.

 

But Commands point of view no change whether it is old driver files ( at45.c, at45d.c ) or new driver files ( dataflash.c and spi_driver.c ).

in the new driver files they included AT45DB641E Also, but if the samba 2.12 is not supporting means, i think its useless to modify the driver files also.

 

 

Sorry for the long mail,

 

but we are in some urgent need to complete this Module.

 

Hope you understand,

 

Please do the needful.

 

Pujitha Beta
KONE ELEVATORS India Pvt. Ltd.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

pujithabeta wrote:
    -> is sam-ba using those .bin files to run and program my device?

Yes, sam-ba runs "applets" on the target. You might have to rebuild the applets, looks to be some useful hits just from googling "sam-ba rebuild applets".

/Lars

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

Thank you for the reply,

 

Lajon wrote:

Yes, sam-ba runs "applets" on the target. You might have to rebuild the applets, looks to be some useful hits just from googling "sam-ba rebuild applets".

 

by looking in to this document http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-42438-SAM-BA-Overview-and-Customization-Process_ApplicationNote_AT09423.pdf , i tried to update the at45.c file and Makefile for dataflash in sam - ba 2.12.

 

but what is the correct sourcery codebench tool chain version ( for AT91SAM9260 CHIP = ? ) i need to install to re compile the applets, i tried to follow the instructions in above document on how to re compile the applets, and installed some version ("arm-2013.11-24-arm-none-eabi.exe" ) but it is not re compiling the applets, not even detecting the "make" command in command prompt.. 

 

any links or softwares available to re compile the applets?

 

Pujitha Beta
KONE ELEVATORS India Pvt. Ltd.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you can't run make then you have not installed Gnu Make according to the instructions in the document.

/Lars

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

yes, you are correct, i downloaded but forget to add path in Environmental variables. 

i am able to generate new bin. but i found that, the previous bin files used in my project from samba tool are from very long, i.e 2005 bin files and they are very different from the current generated bin file ( ex : SAM-BA-DataFlashRead.bin ). the bin file i added compiled in 02 -11 - 2006.

 

i don't know whether bin file name is changed in samba like that or in 2006 sam ba provided this kind of bin generating applets ( now in current 2.12 samba not available ). i am working on changing the entire sam ba files for my project, if it is not working i come back again, i need 1 or 2 days time to modify and test the entire new samba files in current working board.

 

 

thank you for your reply.

 

Pujitha Beta
KONE ELEVATORS India Pvt. Ltd.

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Hi,

 

the Problem got solved after checking some articles in Microchip website.

They have fixed some bug for the this chip AT45DB641E in at45.c

 

For Reference :  https://microchipsupport.force.com/s/article/Migrating-from-AT45DB642D-to-AT45DB641E-on-AT91SAM9260-EK

 

After Updating these changes in SAM-BA and in my Application Project for at45.c file, now i am able to Access Entire Chip Memory (8MB).

 

 

Thank you for the Support.

Pujitha Beta
KONE ELEVATORS India Pvt. Ltd.