MQX application is not booting from QuadSPI_NAND flash

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MQX application is not booting from QuadSPI_NAND flash

Jump to solution
4,545 Views
abdulnihad
Contributor III

I have developed an mqx based audio application using vybrid tower system.I am using DS5 for my development. I have flashed hello_world application to QuadSPI serial nand flash using quadspi_load application available in the vybrid sample code. hello_world application is booting from quadSPI when I configured J22 jumper for QuadSPI boot. hello_world application is not using mqx.

 

Now I want to boot my mqx audio application from QuadSPI serial nand flash. SO I added quadspi_boot.c,quadspi_boot.h and sram_ds5_a5.scf file from

Freescale\Freescale_MQX_4_0\mqx\examples\bootloader_vybrid_qspixip application. builded and created c array file using fromelf --cadcombined <audioApp_a5>.axf --output flash_bin.c

 

I have flashed flash_bin.c using quadspi_load application available in the vybrid sample code.(modified quadspi_load application to accept my flash_bin.c ).

flashing was success. But audio application is not booting from quadSPI when I configured J22 jumper for QuadSPI boot.

 

Please help me to fix the booting issue.

size of flash_bin.c is 850 KB

size of flash_bin.o is 164 KB ( after compiling using quadspi_load application available in the vybrid sample code)

I am attaching quasdpi_boot.c,quadspi_boot.h and QuadSPI_XIP.scf ( slightly modified version of sram_ds5_a5.scf) which I used in my audio application for reference.

 

BR/-

Nihad

Original Attachment has been moved to: QuadSPI_XIP.scf.zip

Original Attachment has been moved to: quadspi_boot.c.zip

Original Attachment has been moved to: quadspi_boot.h.zip

Labels (4)
1 Solution
2,721 Views
juangutierrez
NXP Employee
NXP Employee

I think I found the problem :smileyhappy:

It seems to have a wrong set of values in the quadspi_conf structure

I compared this values against one image that is working for me and they are different, copying the values from the working binary to the binary you provided (patching the binary) I can see the next logs

......................Starting Application................................

on main_task

IPCFG: Device init failed. Error = 0xA414

IPCFG: Failed to bind IP address. Error = 0x1D03

Created ETH_LISTENER_TASK, taskid:0x10003

cmd -> open

Resetting and Latching tuner configuration

TunerCMDListner_task created, id 0x10005

exiting main_task

Initialising Polled I2C driver.........

Set i2c current baud rate to 100000

Set i2c in master mode

Set i2c target address to 0x61

I2C_STATE_READY

tuner opened

cmd -> init

InitTunerI2S error: Unable to open audio device.

Initialising Radio....

RadioInit: Chip Version = cb

rds_task created, id 0x10002

Could not create Tuner_task

init tuner err=-1

cmd -> on

Resetting and Latching tuner configuration

tuner on

This is the configuration that works for me

const SFLASH_CONFIGURATION_PARAM quadspi_conf = {

  0,                      /* DQS LoopBack */

  0,                      /* Reserved 1*/

  0,                      /* Reserved 2*/

  0,                      /* Reserved 3*/

  0,                      /* Reserved 4*/

  0,                      /* cs_hold_time */

  0,                      /* cs_setup_time */

  0x1000000,              /* A1 flash size */

  0,                      /* A2 flash size */

  0x1000000,              /* B1 flash size */

  0,                      /* B2 flash size */

  1,                      /* SCLK Freq - 60Mhz*/

  0,                      /* Reserved 5*/

  4,                      /* Quad Mode Flash */

  0,                      /* Port - Only A1 */

  0,                      /* DDR Mode Disable */

  0,                      /* DQS Disable */

  0,                      /* Parallel Mode Disable */

  0,                      /* Port A CS1 */

  0,                      /* Port B CS1 */

  0,                      /* FS Phase */

  0,                      /* FS Delay */

  0,                      /* DDR Sampling */

  /* LUT Programming */

  /* Quad read*/

  0x046B,

  0x0818,

  0x0C08,

  0x1E80,

  0x2400,

  0x0000

};

View solution in original post

0 Kudos
29 Replies
482 Views
juangutierrez
NXP Employee
NXP Employee

I have not done it (program the OTP fuses) but there is a sample that is is supposed to do that in the

VYBRID_SAMPLE_CODE_SBCH at http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=TWR-VF65GS10&fpsp=1&tab=Design_Tools_...

This is bare-metal code. Just be careful since this can brick your Vybrid if doing it wrong. In RM there is info about which fuses should be programmed to QSPI.

0 Kudos
482 Views
abdulnihad
Contributor III

Thanks Juan, will try that..Mean while could you please tell me why my below stuff is not booting

I migrated my application to MQX4.1 from MQX4.0.2...., Now I am not able to boot my application from QSPI flash in vybrid tower. size of my MQX4.0.2 application flashed in QSPI is 129KB. and size of my MQX4.1 application is 160KB.

BR/-

Nihad

0 Kudos
482 Views
kef2
Senior Contributor IV

Abdul,

Could you try lighting a LED and enter forewer loop at start of your app and see if it boots? It should be done before low level clocks initialization etc.

I found a problem in my clocks initialization routine QuadSPI XIP boot mode and switching SYS_CLK_SEL . Don't know if this has anything to do with your issue, but newer MQX release may have different clocks setup routine and face the same problem.

0 Kudos
482 Views
juangutierrez
NXP Employee
NXP Employee

Hum, that is weird

Is this the size of the binary or the elf file?

If is the binary maybe some section is not being initialized (zeroed).

Try to check the section info with readelf tool, or check the map file and see if all the symbols are kept.

0 Kudos
482 Views
juangutierrez
NXP Employee
NXP Employee

Yes, I think as Edward pointed the problem is with the RCON31/PTB2 pad. I can only think in a pull down resistor since this value is taken on POR.

0 Kudos
490 Views
abdulnihad
Contributor III

Thanks Juan it is working.

Now another requirement:

In Our target platform based on Vybrid tower, there is no DDR3 RAM. SO I want to run my application completely from Internal SRAM. But performance of my application degraded compared to DDR version of application(Which uses ddr.scf from MQX tool kit). I wanted to use complete 1.5 MB of internal SRAM including OCRAM-gfxRAM for my application. As I mentioned earlier I am Using DS5 for development. How to add OCRAM-gfxRAM to scatter file to use in my application.

BR/-

Nihad

0 Kudos
490 Views
kef2
Senior Contributor IV

Abdul,

Scatter files are easy editable. When you open them in DS-5, please note *.scat tab below the diagram. You need to click it to switch to editing mode.

Executing from SRAM slower than from DDR? Probably your MMU settings make DDR cacheable, but not SRAMe.

BTW, even though instruction cache doesn't need MMU enabled, for some weird reason DS-5 likes to use arrays of address labels on every occasion.

 

;;;126 CCM->CCGR2 |= CCM_CCGR2_CG8(0x3);

000008 e59f512c LDR r5,|L1.316|

00000c e5955048 LDR r5,[r5,#0x48]

000010 e3855803 ORR r5,r5,#0x30000

000014 e59f6120 LDR r6,|L1.316|

000018 e5865048 STR r5,[r6,#0x48]

...

 

|L1.316|

DCD 0x4006b000

Instead of immediate addressing, which would utilize only I-cache, compiler in snippet above makes two data accesses for const address stored at L.316. This is of course slow, unless you map (in MMU) code memory D-cacheable... I'd prefer using D-cache for data, not code, but maybe I don't see something. 

0 Kudos
490 Views
abdulnihad
Contributor III

I have created new thread for mmu related issue. Please post your valuable support there.

How to manage mmu in vybrid using DS5

BR/-

Nihad

0 Kudos
490 Views
juangutierrez
NXP Employee
NXP Employee

Hi Nihad

Glad to hear is working.

Would you mind to mark as correct the answer and create another thread for the new question. please?

Post the link to the new thread here so I can continue with the follow up.

0 Kudos