question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question about `bios_flash_offset` in `targets/kosagi_fomu.py`

See original GitHub issue

In the kosagi_fomu.py file the --bios-flash-offset argument has a default of 0x60000 but the flash function disregards its bios_flash_offset argument and always places the bios at 0x0020000. I would have thought this was a bug but using the file I can successfully boot into bios while leaving the bios_flash_offset value at 0x60000. I could be missing something, why does this work? https://github.com/litex-hub/litex-boards/blob/4b48f15265c902dc2931809444b5eb803023d0b5/litex_boards/targets/kosagi_fomu.py#L120-L161

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
enjoy-digitalcommented, Jul 21, 2021

Thanks @xobs, I indeed wanted to have confirmation of the offset introduced by the DFU programmer (ie that a write at 0 is physically localed at 0x4_0000 in the SPI Flash).

In this target, we are relying on DFU for the flashing and then using XiP for the BIOS, so we just need to handle this offset which is now the case.

1reaction
xobscommented, Jul 21, 2021

With Foboot, it doesn’t matter /where/ the BIOS goes since:

  1. RISC-V code is mostly PIC within a 4 MB window, and
  2. BRAM can shift anywhere since it’s not actually reading from flash

The program that it jumps to is usually located at offset 0x4_0000 from the start of flash, or address 0x2004_0000 in memory-mapped RAM (SPI is mapped XIP at `0x2000_0000). See https://github.com/im-tomu/foboot/blob/master/doc/FLASHLAYOUT.md for the flash layout – I wish we had memory maps generated as part of the documentation.

I’m not sure what the situation is with this command, since I’ve never used this to prepare an image. However, if you’re loading a bitstream from SPI flash, then indeed it will be located on the flash chip at offset 0x4_0000.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found