salihonur
Posts: 2
Joined: Sun Aug 14, 2022 1:20 pm

Always goes into boot mode - Not upload to flash

Sun Aug 14, 2022 1:48 pm

Hi,

I designed a custom board based on the design book. I developed the C software and tested on Pi Pico. Then I upload to my board.

If I set "no_flash" in CMakeLists like below, the software runs properly. However it can't to upload into the flash. After uploading the software it goes to the boot mode again. It never runs the software.

Code: Select all

pico_set_binary_type(usb_button no_flash)
I played many variations in the file pico.h in the sdk. Also I created new one and also I played with CMakeLists commands.

I tried two different flash chips. PM25LQ010B (1 Mb) and SST26VF064B (64 Mb). I believe that the problem is caused by the wrong setting of flash communication. Could you help me how to fix it?

pico.h file

Code: Select all

//#define RASPBERRYPI_PICO 
#define USB_BUTTON_BOARD

// --- UART ---
#ifndef PICO_DEFAULT_UART
#define PICO_DEFAULT_UART 0
#endif
#ifndef PICO_DEFAULT_UART_TX_PIN
#define PICO_DEFAULT_UART_TX_PIN 0
#endif
#ifndef PICO_DEFAULT_UART_RX_PIN
#define PICO_DEFAULT_UART_RX_PIN 1
#endif

// --- LED ---
#ifndef PICO_DEFAULT_LED_PIN
#define PICO_DEFAULT_LED_PIN 25
#endif
// no PICO_DEFAULT_WS2812_PIN

// --- I2C ---
#ifndef PICO_DEFAULT_I2C
#define PICO_DEFAULT_I2C 0
#endif
#ifndef PICO_DEFAULT_I2C_SDA_PIN
#define PICO_DEFAULT_I2C_SDA_PIN 4
#endif
#ifndef PICO_DEFAULT_I2C_SCL_PIN
#define PICO_DEFAULT_I2C_SCL_PIN 5
#endif

// --- SPI ---
#ifndef PICO_DEFAULT_SPI
#define PICO_DEFAULT_SPI 0
#endif
#ifndef PICO_DEFAULT_SPI_SCK_PIN
#define PICO_DEFAULT_SPI_SCK_PIN 18
#endif
#ifndef PICO_DEFAULT_SPI_TX_PIN
#define PICO_DEFAULT_SPI_TX_PIN 19
#endif
#ifndef PICO_DEFAULT_SPI_RX_PIN
#define PICO_DEFAULT_SPI_RX_PIN 16
#endif
#ifndef PICO_DEFAULT_SPI_CSN_PIN
#define PICO_DEFAULT_SPI_CSN_PIN 17
#endif

// --- FLASH ---

//#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1		// With and without
//#define PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H 1		// With and without
#define PICO_BOOT_STAGE2_CHOOSE_IS25LP080 1		// With and without

#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64		// Without and with 64 / 128

#ifndef PICO_FLASH_SPI_CLKDIV
#define PICO_FLASH_SPI_CLKDIV 2	// with 2 / 4 / 8 16
#endif

#ifndef PICO_FLASH_SIZE_BYTES
#define PICO_FLASH_SIZE_BYTES (128 * 1024)	// for PM25LQ010B = 128*1024, for SST26VF064B = 8 * 1024 * 1024
#endif

// Drive high to force power supply into PWM mode (lower ripple on 3V3 at light loads)
#define PICO_SMPS_MODE_PIN 23

#ifndef PICO_RP2040_B0_SUPPORTED
#define PICO_RP2040_B0_SUPPORTED 0	// with 0 / 1
#endif
What I tried in CMakeLists.txt

Code: Select all

#pico_set_binary_type(usb_button no_flash)  # To test if the software is working

#pico_define_boot_stage2(slower_boot2 ${PICO_DEFAULT_BOOT_STAGE2_FILE})
#target_compile_definitions(slower_boot2 PRIVATE PICO_FLASH_SPI_CLKDIV=4)
#target_compile_definitions(usb_button PRIVATE PICO_XOSC_STARTUP_DELAY_MULTIPLIER=64)

#pico_set_boot_stage2(usb_button slower_boot2)

#SET(PICO_DEFAULT_BOOT_STAGE2 "boot2_generic_03h")
Image
Image
Image
Image

dthacher
Posts: 474
Joined: Sun Jun 06, 2021 12:07 am

Re: Always goes into boot mode - Not upload to flash

Sun Aug 14, 2022 4:05 pm

The schematic did not declare a connection to QSPI_CS so it did not make one. It only added the pull up and button connections. There is nothing connected to pin 56 on the PCB. Hopefully your better than me with a soldering iron.
There is more I could say here but I am going to leave it at this. Till the world is not a complete waste of time.

salihonur
Posts: 2
Joined: Sun Aug 14, 2022 1:20 pm

Re: Always goes into boot mode - Not upload to flash

Sun Aug 14, 2022 11:19 pm

What a painfull mistake :o Finally I wired and it works properly. Thank you very much.

immortal_sniper1
Posts: 13
Joined: Mon Oct 03, 2022 6:28 pm

Re: Always goes into boot mode - Not upload to flash

Wed Oct 05, 2022 5:59 am

sorry to bother you but how did you determine that PM25LQ010B (1 Mb) and SST26VF064B (64 Mb) are going to work with the RP2040?
Also did u need to make any major changes to the bootloader?

Return to “Other RP2040 boards”