AnsweredAssumed Answered

Boot issues with Rev 1.4 mx233 (Probably BCB issues)

Question asked by hak8or on Jan 4, 2015
Latest reply on Jan 10, 2015 by hak8or

Hello, I have a project using the MX233 (128 pin LQFP MCIMX233DAG4C off digikey, no OTP blown) and am trying to get linux running on it but have been having issues with it booting and understanding the boot process. I don't need the image to be encrypted or anything like that, just want boot.

 

From what I understand, it

  1. Jumps to the ROM and executes ROM code which attempts to copy code from the peripheral selected using the boot pins.
  2. Assuming SD card selected, it attempts to load the SD card and find the MBR in the first sector and if not found then the BCB at the last sector.
  3. ROM code checks if the BCB contains the correct signature and version. If signature or version is bad, appropriate error is displayed on debug UART.
  4. ROM code searches each memory region specified by the BCB containing the correct tag at the first word.
  5. If a tag is found then ROM de-encrypts the encrypted image after the tag and loads it into the 32k OCRAM's Application load Area from address 0x00003FFF -> 0x00000000
  6. ROM sets the PC to 0x00000000 and hands off/jumps execution to the now de-encrypted application code
  7. Code does whatever it wants (setup DRAM, change clocks to full speed, etc).
  8. In the case of uboot it initializes the DRAM, copies remaining code from SD card to DRAM, and hands off execution to the new code from DRAM.

 

I am getting various error codes (0x80501003 which says bad file signature) on the debug uart which indicates that things seem to be working fine (Power, clocks, etc) except for DRAM since I didn't get to check that yet. After fumbling around with various images and being unable to get anything to boot, I have decided to start off from a simple example, make my own BCB and a LED blink without linux or uboot. But here is my problem, the boot control block differs across the Freescale forums and datasheet and elsewhere, so what should I use?

 

The datasheet gives the following, but both here i.MX233: information about SD/MMC boot from BCB and here Booting custom I.MX233 board via BCB | Freescale Community give different structures and signatures. Should I use the values from the datasheet as shown below?

// Signature 0x4D454D53
// Version   0x00000001
// Tag       0x00000050

typedef struct {
  drive_type_t eDriveType;
  uint32_t Tag;
  uint32_t Reserved[5];
} media_regions_t;


typedef struct {
  uint32_t Signature;
  uint32_t Version
  uint32_t Reserved[1];
  uint32_t NumRegions;
  media_regions_t Regions[];
} media_config_block_t;


 

But regardless, I tried using the signatures and structure from both of those links and the code example from the second link, modifying the IMAGE_START_BLOCK to the correct value, but then either get nothing on the debug UART nor a blinking LED, or the good ole 0x80501003 error. Here is the writer and shell script I use to write it to the SD card.

 

I am using a 16GB SD card I got off amazon from a reputable vendor and tests by writing data to the card and then reading back verify it works. I attached an fdisk regardless just in case. My BCB is being written to /dev/sdb3.

Command (m for help): p

Disk /dev/sdb: 15 GiB, 16037969920 bytes, 31324160 sectors

Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disklabel type: dos

Disk identifier: 0x4195295b

 

 

Device     Boot    Start      End  Sectors  Size Id Type

/dev/sdb1           2048    32000    29953 14.6M 83 Linux

/dev/sdb2          32001 31324158 31292158 14.9G 83 Linux

/dev/sdb3       31324159 31324159        1  512B 83 Linux

So, does anyone know what's up with the BCB structure and version? And, in the data sheet provided version, I don't see where the sector location for each media_regions_t is specified, not to mention I don't understand what eDriveType is supposed to mean. Without that info I don't really understand how to change the bcb.c to accommodate this new BCB.

 

Thank you for any potential help.

Outcomes