You are reading a single comment by @fanoush and its replies. Click here to read the full conversation.
  • Well maybe using the XIP region where flash is actually mapped would be good idea.

    https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf#page=150
    2.6.3. Flash

    Not sure how writing to flash works when XIP is enabled, it will probably block executing from flash in similar way as on nrf5x where any execution is halted when erasing/writing.
    How does it work on ESP32/8266? It is exactly the same problem there.

  • reading directly from flash works fine
    writing needs disabling of irq
    If somebody has a better solution, you are welcome

    mask = getIrqMask();
      irq_set_mask_enabled(mask,false);
      flash_range_program(FLASH_TARGET_OFFSET, addr + i * FLASH_PAGE_SIZE, FLASH_PAGE_SIZE);
      irq_set_mask_enabled(mask,true);
    
About

Avatar for fanoush @fanoush started