This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SPI flash reboot problem on Beaglebone Black

Other Parts Discussed in Thread: AM3352

I am working with SPI Flash (N25Q256) connected to BBB to simulate operation of our target hardware which will contain N25Q256 connected to AM3352 on SPI0. To achieve this I have a N25Q256 chip on a small board with its SPI pins (CLK, CS, MOSI and MISO) connected to the respective SPI0 pins of BBB. As described in my earlier questions Booting Beaglebone Black from SPI Flash (N25Q256) and MTD on Beaglebone Black to access SPI Flash (N25Q256) we have got everything going except one problem which I cannot resolve.

If SPL and booloader are read from SPI flash, and subsequently m25p80 driver starts (either as built-in driver or loaded module), I cannot reboot using a reset button or init 6. It appears that the SPI controller has trouble restarting as I do not even see the very first signature of U-boot SPL on the console. For this problem to happen, I can load the kernel and rootFS from SPI flash or the network.

If I disconnect the power and then power up BBB again, I can boot from SPI flash with no problems.

If I load the same kernel (from the network) but do not  load m25p80 driver, I can reboot and read SPL and booloader from SPI flash with no problems.

If I boot from any other source rather than SPI flash (SD card, EMMC or the network) reboot from that source can proceed with no problems with or without m25p80 driver working.

Regards


Eugene

  • Hi,

    Eugene Zilberg said:
    I cannot reboot using a reset button or init 6

    Can you please describe how you are trying to reboot in more detail?

  • Hi Eugene,

    Apologies for the delayed response.

    I've been looking for some time at AM335x PRM sources: arch/arm/mach-omap2/prm33xx.c & arch/arm/mach-omap2/pm33xx.c, but I couldn't find a reason for the board behavior you described.. I didn't notice a connection between the m25p80 driver & reset management, especially the hw reset (using reset button S1 on BBB).
    As I see reset button is connected to NRESET_INOUT (ball A10 on am335x chip, zcz package) and issues a SYS_RESETn to the LAN8710A chip & pin 10 on P9 expansion connector. I was not able to see a reason (from sw point of view) why using m25p80 driver would prevent the reset issued from the hw button.

    Have you reviewed your hw setup?

    Best Regards,
    Yordan
  • Hi Yordan

    I believe that I managed to sort this problem out a few days ago. I have not posted yet as I am still testing my solution.

    m25p80 driver sets 4 byte address mode in the function m25p_probe. When I reboot BBB, the SPI flash probably stays in this mode and therefore cannot respond correctly to ROM bootloader read command?

    To test this I added a call set_4byte(flash, info->jedec_id, 0) (which returns SPI flash into 3 byte address mode) to the driver function m25p_remove. After I loaded m25p80 driver as a module with insmod m25p80.ko and then removed the driver with rmmod m25p80.ko, I was able to reboot. However if I load and then remove m25p80 driver built without adding set_4byte(flash, info->jedec_id, 0) into m25p_remove, I cannot reboot.

    Is this a correct explanation?

    Regards

    Eugene