For project we have created custom board based on atmel sama5d27 processor. We are facing some issues regarding working with DDRAM2 used on board. We are using this board for bare application development.
Processor used: ATSAMA5D27C-CNRTR-ND
DDRAM2 used: MT47H32M16NF-25E IT:H TR
From github we have downloaded at91bootstrap and built it using arm-none-eabi-gcc (linaro toolchain can be used for at91bootstrap, but for atmel softpack it cant be used (some errors for nano.specs occur). We have following situtation:
We have assembled 3 boards and we get 3 different behaviors:
bootstrap is built with settings:
For all boards when program is loaded trough IAR using jtag and atmel-ice everything works fine. When trying to execute from QSPI flash we are facing following issues.
Code: Select all
Image loading strategy: Load 1MB into start of SDRAM The external Ram Address to Load Demo-App Image: 0x20000000 Demo-App Image Size: 0x000a0000 (it is bigger than image actual size) Flash offset for Demo-App: 0x00010000
First board we get messages from at91bootstrap, execution is then moved to ddram and application built using IAR is executed properly.
Two other boards have following behaviors:
AT91bootstrap is executed properly but program from ddr2 is not executed. With modifications in bootstrap main function we set that content from ddram before jumping to address is printed on console. We got that content of memory is on one board 0x0000 and on another 0x0100. We tried to write to memory and read it. It is possible to read immediately but with any delay before writing and reading content of memory is lost.
From hardware side all boards should be same, assembly was done mechanically. Regarding registers for ram controller is there something that might be important and it is not set.
DDRAM is configured as:
Settings for timings are taken from memory datasheet.
Code: Select all
ddramc_config->mdr = AT91C_DDRC2_DBW_16_BITS | AT91C_DDRC2_MD_DDR2_SDRAM; ddramc_config->cr = AT91C_DDRC2_NC_DDR10_SDR9 | AT91C_DDRC2_NR_13 | AT91C_DDRC2_CAS_5 | AT91C_DDRC2_NB_BANKS_4 | AT91C_DDRC2_NDQS_ENABLED | ~AT91C_DDRC2_UNAL_SUPPORTED;
If anyone have any idea what could cause such strange behavior any help will be very useful.