This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Need interface MCU initial boot firmware

Please don't give the usual response of 'try the troubleshooting guide' to flash the J-Link or Mbed firmware.  

What I (and probably others) really need is the real initial bootloader firmware for the AT91SAM3U2 that shows up as the BOOTLOADER drive when the IF/BOOTRESET pin is pressed on power on.  It seems that if the J-link operational firmware is corrupted, no amount of BOOTLOADER recovery seems to work to restore the J-Link.  I'm able to restore the Mbed firmware but that just allows the device to show up as a USB drive to program the nRF52x code which is *not* what i need to do.

I've been unable to determine where the actual initial Mbed-enabled boot code is.

What i've done is cut SB31 and applied VDD to the ERASE pin of the interface MCU to get the SAM-BA bootloader interface connected.  Then i've attempted to 'Enable Flash Access', 'Erase All Flash', 'Send File Name' with the .bin file for the J-Link firmware, and then finally 'Boot From Flash (GPNVM1)' before cycling power to the DK board.  There's no detection of the USB link after that.  I've obviously erased the initial Mbed bootloader because it doesn't appear anymore when IF/BOOTRESET is pressed during power on.  

It seems to me there's the initial Mbed-enabled bootloader for the interface MCU which will boot into either the J-Link firmware or the Mbed firmware if they exist, but the J-Link and secondary Mbed firmware don't include the initial boot capability.  I'd rather not have to get the Mbed development software and build my own since Nordic has already done it.

  • ok, for any subscribers of this issue, some further debug and i've gotten the mbed bootloader back installed and showing up as a drive.  i actually found this link: https://devzone.nordicsemi.com/f/nordic-q-a/37759/alternative-way-to-re-flash-interface-mcu-using-tc2050-j3-on-pca10040 which describes exactly what i already figured out by reading the AT91SAM3U2 datasheet and the nRF52 DK schematic.  (forgot to mention, applying VDD to the cut SB31 was simply a wire on one of the nRF current management pins to SB31 1/2 moon closest to the chip for a second while applying power).  

    when i used the 140828_MBED_bootloader.bin from the link above (scroll down to the bottom, file is JLINK Restore.zip) i'm able to get back to the BOOTLOADER drive with the IF/BOOTRESET button. 

    previously, the firmware i was trying to load was called nrf5x_atsam3u2c_if_mbed_V0221_11012017.bin (a 35K file), vs the 140828_MBED_bootloader.bin file which is 19K.  The nrf5x_xxx file is what you get from the nRF52 DK downloads page.

    please note that the above zip file has a guide in it that basically says that it may not work in all cases, so YMMV.    If you have a new board like mine, be aware that the SB31 is shorted to GND, use a razor blade to cut the link.  The MCU has a permanent pulldown already so it should work as normal without it.

    i'm still not able to get the board to show up as a JLINK device though, but after sending the JLINK firmware to it and restarting, LED5 is flashing pretty fast, maybe 10Hz.  windows recognizes *something* based on the sounds, but nothing shows up in device manager.  i'm wondering if the security bit needs to be enabled for the JLINK firmware to boot.  perhaps they are protecting it?  well, just tried that and it didn't make a difference.   continue digging.

  • it would seem that there's an issue with the size of the firmware for the interface MCU.....  if they are intended to live together in the flash of this device, the MBED firmware binary from the Nordic download page is 35K, and the JLINK firmware binary is 108K, there's some overrun because there's only 128K of flash in this MCU.  (verified by reading the CHIPID register and issuing the flash read descriptor.)

    last thing i've tried today is concatenating the smaller mbed firmware with the JLINK firmware (padded to the next 1K boundary, i presume the bootloader starts scanning there) in a single file and sending that to the flash with the SAM-BA loader and rebooting.   I get the same 10Hz flashing led5 as above, rather than the MBED bootloader led 1/2Hz flash.   holding the IF/BOOTRESET and powering up give me the BOOTLOADER drive (as expected), which flashes at 1/2Hz for a bit and then disconnects from USB and then flashes at 1Hz.   power cycling after that results in no led flashes, as though the JLINK firmware doesn't start at all...... maybe the MBED bootloader erases the application flash area?  i'm able to go to BOOTLOADER again and drag/drop the JLINK FW again, a reboot gets the 10Hz flash.

  • Hi,

    You are right that you can re-program the onboard debugger IC using the firmware (bootloader and J-Link application firmware) from the JLINK Restore.zip found in this post. You can also refer to the more extensive documentation from Segger. Based on what you have described you have done as explained in the document, and also installed the J-Link OB-SAM3U128-V2-NordicSemi 170213.bin via DFU, so it should be OK.

    Regarding size that is no problem. You can fit both the bootloader and the application, and this is what is used in production of the DKs. If you do a flash erase of the debugger IC and programs the bootloader, you should then be able to install the J-Link firmware by drag-and-drop (USB DFU), and you would end up with the same configuration as the DKs are shipped with.

    I am not sure what to make of the states described in your last post, to be honest. May I ask why you started endeavor this in the first place? Perhaps that can also give some hints on the issue you are seeing.

  • what started this in the first place is the same problem lots of people have, when the firmware in the interface MCU is overwritten/corrupted somehow they are unable to restore it.  I don't really know how it got corrupted though, i read something about how when the JLINK Commander/Configurator attaches it automatically attempts to update the JLINK FW to the latest?  i didn't recall seeing any sort of popup asking if that's what I wanted, and if it just does it without asking i think that's poor user experience/expectations.  

    when i somehow lost the JLINK firmware (i did see it at least the first time i plugged it in), i tried the normal process of restoring as described for the typical usage model of drag/drop but that obviously wasn't working.  because this issue has already cost me several days of possible development (i didn't even start yet) i didn't want to have to wait for a new DK to be sent to me and figured there must be a way to reflash it myself.  so as I do, I dug into the documentation of the SAM3U part and figured out there's a (mask?) ROM'd monitor that can be used to recover so i did that.

    So i'm guessing that the mbed bootloader that's linked on the nrf52 DK page is an updated bootloader with a flash progamming bit of code included because the bootloader can't do self-update (it's only XIP?).  the bootloader that i got from the .zip file must just be the mbed bootloader itself with no flash progamming update code...

    either way, i'm unable to recover the JLINK FW for some reason.

    see my other post, i was able to install the DAPLink FW just fine using their bootloader.

  • I checked with the production guys, and they now use a single binary in production: concat_mbed_170117_jlink_180712.bin. Can you try with this?

Related