guestinator has quit [Remote host closed the connection]
guestinator has joined #openocd
<gamiee>
Hi PaulFertser: yeah I noticed this behavior after I removed bunch of "mem" stuff in my gdb init file.
<gamiee>
What I am surprised is that when "load" is issued, gdb most likely issues reset. What I know is that Flash is not configured properly. Sadly, since chip is already probed, the init which is in probe function doesn't trigger, thus Flash functions are executed without flash being initialized at all.
<gamiee>
Should I re-initialize Flash on every flash action or how this should be handled?
guestinator has quit [Remote host closed the connection]
guestinator has joined #openocd
akaWolf has quit [Ping timeout: 252 seconds]
<PaulFertser>
gamiee: by default "load" should lead to flasherase command which in OpenOCD by default does "reset init" which is the established way to prepare for flashing.
Haohmaru has joined #openocd
<gamiee>
PaulFertser: ah okay! good, so that explains why chip is reset. So this leads me to the another question, where I should initialize flash then? I would expect that reset init also calls probe again.
akaWolf has joined #openocd
<PaulFertser>
gamiee: hm, no, flash probing happens just once per session, either after explicit "flash probe" command or by auto-probing via any flash operation.
Hawk777 has quit [Quit: Leaving.]
<gamiee>
PaulFertser: so when I should be initializing the flash? In auto-probe routine?
<gamiee>
Or in every flash related function ?
<gamiee>
the probing only once per session makes sense, that's good. But sadly, even when I tried to inspire from other flash bank drivers, I did not figured out where they initialize flash.
<PaulFertser>
gamiee: I think in the probe function you should do everything needed to basically provide good output for "flash info 0" command but you can not count on hardware state to persist later. What you should be able to count on is that flash functions are called after "reset init", that is, "reset halt" and then the reset-init Tcl hook executed.
<PaulFertser>
gamiee: most flash controllers do not require any kind of explicit initialisation.
<gamiee>
PaulFertser : that
<gamiee>
oops :D
<gamiee>
That
<gamiee>
aaaaa
<gamiee>
That's strange, for BL602/BL702 etc., I need to init GPIOs for flash (both internal and external flashes are connected through gpio) and also configure some basic information, like if it's QSPI or SPI, delays etc. Without this configuration, every flash command fails.
<gamiee>
From this, it seems that I should rather initialize flash on every action, or dunno. :/
<gamiee>
Any ideas what would be best to do please?
joconor has quit [Ping timeout: 252 seconds]
joconor has joined #openocd
<PaulFertser>
gamiee: I might be able to some example in the code base but no promises.
<gamiee>
PaulFertser: OK thanks. Well, in worst case, I will just initialize it always, or do some detection.
<PaulFertser>
gamiee: you can see from e44539d66c8929679321704768125df9ba7d5f67 that stm32 qspi interface init is all handled in board config files (as it's board specific) in reset-init handler.
<gamiee>
ohh wait, so I should do flash init in TCL rather in flash bank driver? :O
<PaulFertser>
gamiee: well, sometimes for some targets
<gamiee>
well, I would love to keep it in driver :D like I can still call custom function from driver for that.
<gamiee>
through TCL.
<gamiee>
This reminds me I want to also improve reset mechanism, but I need to run algorithm, what is possible only from C as far as I know... So that's another thing i am not sure how I should do properly :D
Haohmaru has quit [Read error: Connection reset by peer]
Ha0hmaru has joined #openocd
Ha0hmaru is now known as Haohmaru
HelloShitty has joined #openocd
guestinator has quit [Ping timeout: 256 seconds]
guestinator has joined #openocd
guestinator has quit [Remote host closed the connection]