Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading Flash via JTAG #114

Open
TolleWurst opened this issue Jan 15, 2020 · 2 comments
Open

Loading Flash via JTAG #114

TolleWurst opened this issue Jan 15, 2020 · 2 comments

Comments

@TolleWurst
Copy link

TolleWurst commented Jan 15, 2020

Hello,

I am using PULPissimo and currently trying to load the S25FS256S flash via JTAG.
The goal is to be able to load an image, for example an image of the hello_world test, into flash and execute it.
At the moment the pre-loading feature of the flash is used to already have the stimulus in the flash. If the standalone boot is used, the test is correctly executed and the expected "hello" is printed.
This should be changed so that instead of using the pre-loading feature, the stimulus is loaded into flash via JTAG.
I have tried to find information on how you would go about doing that and i'm unsure if this is possible at the moment (without changes or expansions to the jtag_pkg and maybe further changes).

What i found are a few issues regarding similiar topics:
#88
#36
#26

So now i am wondering, is it possible to load an image (for example of the hello_world test, or any other image actually) into the S25FS256S flash via JTAG.
If yes, what would be the necessary steps to do so?
If no, what changes or extensions would be needed to be able to do so?

Edit: Writing via JTAG is possible.

Edit2: So writing into L2 via JTAG works well and fine, but is writing into Flash via JTAG supported? I already mentioned this Issue: #36 and wondered if anything changed now that little over a year went by. Any info is greatly appreciated.

@bluewww
Copy link
Collaborator

bluewww commented Jan 17, 2020

The flash memory s25fs256s is connected to the qspi. We currently don't have a script to flash the chip since we normally run the simulation with the chip already preflashed as you mentioned.

So the way to do this is to write data from the jtag to the L2 and then engage the udma to transfer the data to the flash. The debug module can access the whole address space, thus also the memory mapped udma.
@haugoug

@LPLATU
Copy link

LPLATU commented Mar 4, 2020

So after loading the relevant data into L2 using JTAG (either using debug_mode_if.load_L2 or debug_mode_if.writeMem) how would you recommend loading that data into the flash?

I'm thinking one way would be to write a program using the SPIM driver from the PULP Kernel Library. But this would require the core to do the work.

You said that the udma is memory mapped, so is there currently a way to to load the data from L2 to the flash while halting the core (maybe via SPI?), similar to using JTAG to load the data into L2 first?
And if there is a way, how would i go about doing this? Is there a package similar to the jtag_pkg.sv which offers tasks to write from L2 to the flash?

Thank you,
LPLATU

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants