AnsweredAssumed Answered

Booting a different application sampe code: what is BOOTROM_Boot_DXE_SPI

Question asked by MattZ on Nov 8, 2016
Latest reply on Feb 14, 2017 by MattZ

Hi All,

 

I'm using a BF537. I have no problem booting a program via SPI upon startup. However, I'd now like to load a different program from the first running program. I've tried following the example in ADSP-BF537 Blackfin Processor Hardware Reference  "Booting a Different Application". However, I have problems even compiling that same code.

 

The sample code given is:

#include <defBF537.h> /* provides function entry addresses */
P0.H = HI(_BOOTROM_Boot_DXE_SPI) ;
P0.L = LO(_BOOTROM_Boot_DXE_SPI) ;
R7 = 0 (Z) ; /* SPI address is zero */
R6 = PF4 (z) ; /* SPI's /CS connects to PF4 pin */
R5 = 0x0085(Z) ; /* SPI clock divider */
JUMP (P0) ; /* jump to Boot ROM */

 

My compiling problem is _BOOTROM_Boot_DXE_SPI is undefined. I've searched through the ADI supplied code that comes with VDSP++5.2.1 and found it defined in "defBF534.h". According to the BF537 HRM, the Boot-Rom are similar in the 534 and 537. So I've define it myself, copying the value from defBF534.h, like this:

#define _BOOTROM_Boot_DXE_SPI 0xEF00000A

 

However, even with that manual definition, I'm still having trouble with my loading. So I wonder if what I did with the define is correct. Can anyone comment on that?

 

The problem I'm having with my loading is the nCS is not being pulled all the way low. Rather it is only being pulled about 1/2 way to low. I do see the spi clock as expected. However, 

The code I'm using is based on:

  1. "BF537 Hardware Manual r3.4", some sample code is given in "Multi-Application (Multi-DXE) Management" (page 19-28).
  2. This thread: https://ez.analog.com/thread/4200
  3. And this thread: https://ez.analog.com/thread/10685

 

My actual code is:

#include <defBF537.h>

#define _BOOTROM_Boot_DXE_SPI 0xEF00000A

#define L1_SCRATCH 0xFFB00000

FP.H = HI(L1_SCRATCH) ;
FP.L = LO(L1_SCRATCH) ;
SP.H = HI(L1_SCRATCH) ;
SP.L = LO(L1_SCRATCH) ;

P0.H = HI(_BOOTROM_Boot_DXE_SPI) ;
P0.L = LO(_BOOTROM_Boot_DXE_SPI) ;
R7.H = HI(0x000000); // SPI address
R7.L = LO(0x000000); // SPI address
R6 = PF10 (z) ; // SPI's /CS connects to PF10 pin
R5 = 0x0085(Z) ; // SPI clock divider
JUMP (P0) ; // jump to Boot ROM
RTS;

 

Note that my spi flash is connected to the default nCS (PF10) and there is nothing between the BF537 and the sflash's nCS other than a pull up resistor.

 

Any thoughts?

 

Thanks in advance

-Matt

Outcomes