#garfield Logs

Dec 01 2023

#garfield Calendar

11:19 AM rue_mohr: ok, recycling and stuff
11:31 AM rue_mohr: hmm
11:31 AM rue_mohr: what do I do with a 70lb vacuum pump...
04:32 PM rue_shop3: WHAT
04:32 PM rue_shop3: polprog, does function 28c only print "0x" ?
05:05 PM rue_shop3: extern "C" void printHex(uint32_t)) = ((void(*)(const uint32_t ))ROM_PUTHEX;
05:06 PM rue_shop3: #define printHex(X,Y) ((void(*)(uint32_t, uint32_t))ROM_PUTHEX)(X, Y)
05:16 PM rue_shop3: ram at 0000 seems to go to 0x20000
06:11 PM rue_mohr: ok I'm back
06:12 PM OK9UWU: welcome back
06:16 PM rue_mohr: ok, so, where are we at, its not giving you a clean download is it?
06:17 PM OK9UWU: Yup
06:18 PM rue_mohr: ok, 10 pin adapter, TTL2USB
06:19 PM OK9UWU: yep
06:20 PM rue_mohr: in the downlaoder, main.c
06:21 PM OK9UWU: yes
06:21 PM rue_mohr: fwrite(buff, 1, 4096, output); <-- do you have the version with 4096 close to the end of main
06:22 PM OK9UWU: yeah 4096
06:22 PM rue_mohr: ok
06:25 PM rue_mohr: I'm going to try with waitConverse, but I expect the same
06:26 PM rue_mohr: I'll switch it up to a state machine, but I'd like to get you working
06:29 PM rue_mohr: OK9UWU, ok, do a pull and see if that fixes it for you
06:30 PM OK9UWU: aite lets see
06:34 PM OK9UWU: okay i get console output with memory addreses
06:34 PM OK9UWU: incrementing
06:34 PM rue_mohr: yup
06:35 PM rue_mohr: I should make it say success when its done without errors...
06:35 PM rue_mohr: if it just stops, its good
06:35 PM OK9UWU: btw one thing i noticed, i have to change the memory to 00000000 instead of 40000000 otherwise i get "Bogus ISR" return
06:35 PM rue_mohr: oh no
06:35 PM rue_mohr: thats not the right memeory
06:35 PM rue_mohr: 0000000 is ram
06:35 PM rue_mohr: we want the flash
06:36 PM rue_mohr: hmm
06:36 PM rue_mohr: "Bogus ISR" means the drive controller crashed
06:36 PM OK9UWU: interesting
06:36 PM rue_mohr: ok
06:37 PM rue_mohr: thinking...
06:37 PM OK9UWU: wonder if its the controller being bad or if there is different mapping?
06:37 PM rue_mohr: lets do this manually for a second
06:37 PM rue_mohr: connect with a term
06:37 PM OK9UWU: but it shouldnt be, this drive died due to a mechanical damage
06:37 PM OK9UWU: ok
06:37 PM rue_mohr: say when ready
06:37 PM OK9UWU: ok ready
06:38 PM rue_mohr: say "AP 4000000" the space after AP is important, 8 digits total
06:38 PM rue_mohr: 40000000
06:38 PM rue_mohr: :)
06:38 PM OK9UWU: ok done
06:38 PM rue_mohr: ok, say "RD"
06:38 PM OK9UWU: addr ptr = 0x40000000
06:38 PM rue_mohr: with enter
06:39 PM rue_mohr: yup, and the read?
06:39 PM OK9UWU: adr = 0x40000000 bogus isr
06:39 PM rue_mohr: ooo
06:39 PM rue_mohr: wait, is there still a console?
06:39 PM rue_mohr: did it reboot?
06:39 PM OK9UWU: nope its crashed
06:39 PM OK9UWU: hanged
06:39 PM rue_mohr: ok, cycle it
06:40 PM OK9UWU: ok
06:40 PM rue_mohr: there is another memory range for smaller controllers, I have go to find notes
06:40 PM OK9UWU: done
06:41 PM OK9UWU: this one is DAZZ001TQ if it makes any sense to you btw
06:41 PM rue_mohr: AP 00100000
06:42 PM rue_mohr: it should be good with that...
06:42 PM OK9UWU: RD returns data 0x18
06:42 PM rue_mohr: k, 1 min...
06:43 PM rue_mohr: RD again, shouldbe F0 ?
06:43 PM OK9UWU: Yup!
06:43 PM rue_mohr: ok, interesting
06:43 PM rue_mohr: its all in a different location
06:43 PM rue_mohr: stand by
06:43 PM rue_mohr: oh
06:43 PM OK9UWU: roger
06:44 PM rue_mohr: just set the address in that code to 00100000 ad run it then
06:44 PM OK9UWU: ok running
06:45 PM rue_mohr: the part number isn't ST* ?
06:45 PM rue_mohr: oh I know, there is a "PCB 1004* on on the pcb, whats that number
06:46 PM OK9UWU: it does have an STM logo on its but thats all, no ST in the model number
06:46 PM OK9UWU: lemme look
06:46 PM OK9UWU: 66824
06:46 PM OK9UWU: REV C
06:46 PM OK9UWU: 100466824
06:46 PM rue_mohr: there
06:47 PM rue_mohr: oh
06:47 PM rue_mohr: you have the same board as Christian
06:47 PM OK9UWU: Oh nice
06:48 PM OK9UWU: dumper has finished btw
06:48 PM rue_mohr: yea
06:48 PM rue_mohr: you have the same board as Christian ahaha
06:48 PM rue_mohr: so we didn't need to dump it :)
06:48 PM rue_mohr: hahhaah
06:48 PM rue_mohr: ok, back in main.c
06:49 PM OK9UWU: alright
06:49 PM rue_mohr: uncomment #define PCB100466824
06:49 PM rue_mohr: we will see how this goes now, I made a pile of changes...
06:50 PM OK9UWU: there's no other define other than the serial port and timeout)
06:50 PM rue_mohr: heh, back a few dirs
06:50 PM rue_mohr: not in utils
06:50 PM rue_mohr: in the root of the project there is a main.c
06:50 PM rue_mohr: its the main.c for the drive board
06:51 PM OK9UWU: ok got it
06:51 PM rue_mohr: safe main.c with that uncommented, and try make...
06:51 PM rue_mohr: there is all sorts of stuff that comes into play
06:52 PM rue_mohr: it break on puts?
06:52 PM OK9UWU: wait i need to install the compiler for this
06:52 PM rue_mohr: yup
06:52 PM rue_mohr: gcc-arm-none-eabi
06:53 PM OK9UWU: already pulling it, thank god we have apt haha
06:55 PM rue_mohr: :)
06:55 PM rue_mohr: it looks like I have to correct some tings...
06:55 PM OK9UWU: error, "ROM_PUTS" undeclared (first use in this function)
06:56 PM rue_mohr: yep, 1 sec
06:56 PM rue_mohr: oh
06:57 PM Tom_L: is polprog hiding behind a new nick?
06:57 PM Tom_L: no
06:58 PM rue_mohr: no, another drive hacker :)
06:58 PM Tom_L: your group is growing
06:58 PM Tom_L: what drive?
06:58 PM rue_mohr: OK9UWU, #define ROM_2_0 below that other define
06:58 PM OK9UWU: Crashed Seagate baracude
06:58 PM OK9UWU: baracuda*
06:58 PM rue_mohr: Tom_L, seagate
06:59 PM OK9UWU: ok, compiled
06:59 PM rue_mohr: ok!
06:59 PM rue_mohr: next, we upload it
06:59 PM rue_mohr: to utils/loader
06:59 PM rue_mohr: and build that one
07:00 PM rue_mohr: gcc *.c -lpthread
07:00 PM OK9UWU: done
07:00 PM rue_mohr: did you get the use.txt in your sync?
07:00 PM rue_mohr: make sure you dont have the terminal connected when you run it
07:01 PM rue_mohr: or it'll tell you by segfaulting... :)
07:01 PM OK9UWU: yeah i did)
07:01 PM rue_mohr: (its on my fix list..)
07:01 PM OK9UWU: it segfaulted anyway ha
07:01 PM rue_mohr: ugh
07:01 PM rue_mohr: it partly uploaded and faulted? no error text?
07:02 PM rue_mohr: this one actually tells you if it was successfull
07:02 PM OK9UWU: notihng just segfault
07:02 PM rue_mohr: terminal isn't connected?
07:02 PM OK9UWU: nope
07:03 PM rue_mohr: ok, did you change the baud rate on it from 38400?
07:03 PM OK9UWU: no i left it as is
07:03 PM rue_mohr: ok
07:04 PM rue_mohr: and yoru running the loader with that command? ./a.out ../../bin/firmware.bin ?
07:04 PM OK9UWU: yep
07:04 PM rue_mohr: ok lets dial up the comm delay...
07:05 PM rue_mohr: converse occurs in 3 places, want to try 3000?
07:05 PM rue_mohr: I'm gonna edit that into one define..
07:05 PM OK9UWU: alraedy did so, tried 3k and also 10k for a good measure, still same
07:06 PM rue_mohr: ? that firmware.bin actually exists right?
07:06 PM OK9UWU: yeah it does
07:06 PM rue_mohr: ok, stand by a bit
07:07 PM rue_mohr: is /dev/ttyUSB1 working for all this for you?
07:08 PM OK9UWU: i am using ttyUSB0 (yes i changed it in the code) but yeah otherwise its working
07:08 PM rue_mohr: ok
07:08 PM rue_mohr: you may have noticed this softare is a pile of hack just high enough to pass "works for me"
07:08 PM rue_mohr: :)
07:09 PM rue_mohr: stand by..
07:09 PM OK9UWU: well, thats what the feedback like this is for haha :-D
07:09 PM Tom_L: don't go puttin out no crappy hacks now!
07:09 PM rue_mohr: :]
07:09 PM OK9UWU: its about curiosity, not about making fortune500 company type of code
07:10 PM rue_mohr: OK9UWU, it really just crashed without sayin anything...?
07:10 PM rue_mohr: yea, if its gonna change the world, I could never have expected to make any money off it
07:10 PM OK9UWU: yeah, let me figure out how to pass arguments into gdb and i'll give you more in depth analysis of the crash
07:11 PM rue_mohr: it'll be something to do with a null pointer probably
07:11 PM rue_mohr: probably in value()
07:12 PM OK9UWU: gdb just returned that it recieved SIGSEGV some address in main ()
07:12 PM rue_mohr: nice
07:12 PM OK9UWU: not that much helpful
07:12 PM rue_mohr: I dont usually leave debug flags on
07:12 PM rue_mohr: I'v learned that puts(NULL) segfaults
07:13 PM rue_mohr: its probably a short reply
07:13 PM OK9UWU: yeah that was the initial issue with the dumper aswell
07:13 PM rue_mohr: adjusting...
07:14 PM rue_mohr: I'm bad and assume after _2ms_ the serial port has valid data
07:18 PM rue_mohr: ok, all the changes were to main.c of the loader if you want to just grab that file
07:18 PM rue_mohr: I kinda expect you might see "ARG, partial reply" maybe not
07:20 PM OK9UWU: if its the same issue with converse as in the dumper then probably no
07:20 PM OK9UWU: if it gets to crash even before the first printf
07:21 PM rue_mohr: its not that verbose, I think it hit the crash while it was about to say what the error was
07:22 PM rue_mohr: did you notice if the console said it was firmware 2.0?
07:23 PM OK9UWU: yea Boot ROM 2.0
07:23 PM rue_mohr: perfect
07:23 PM rue_mohr: is that recompiling ok?
07:23 PM OK9UWU: ?
07:24 PM rue_mohr: oh, grab the new https://github.com/ruenahcmohr/seaduino/blob/main/utils/loader/main.c
07:24 PM rue_mohr: ;) recompile and give it a try
07:26 PM OK9UWU: okay new error
07:26 PM rue_mohr: ok!
07:27 PM OK9UWU: error mismatc FFFFFFFF != 18
07:27 PM rue_mohr: yup
07:27 PM rue_mohr: just run it again
07:27 PM rue_mohr: I get that too
07:27 PM rue_mohr: usually twice is enough, roll the dice
07:27 PM OK9UWU: so far nothing
07:28 PM rue_mohr: ?
07:28 PM rue_mohr: no success or it hung?
07:28 PM OK9UWU: running it over and over and still same error
07:28 PM rue_mohr: oh
07:28 PM rue_mohr: uh
07:28 PM OK9UWU: i also get return of what "?" would do in the console
07:28 PM rue_mohr: did you update the whole thing? is firmware.bin still there?
07:28 PM OK9UWU: i recompiled
07:29 PM rue_mohr: yup
07:29 PM OK9UWU: both the loader and fw
07:29 PM rue_mohr: oh, you re-edit the fw main?
07:29 PM OK9UWU: yeah
07:29 PM rue_mohr: ok
07:29 PM rue_mohr: how big is firmware.bin
07:29 PM OK9UWU: 522
07:30 PM rue_mohr: yup ok
07:30 PM rue_mohr: oh, you know what, lets try anyway
07:31 PM rue_mohr: after running the loader
07:31 PM rue_mohr: oh, did it seem to write a bunch and then crash?
07:31 PM OK9UWU: not really sure, seems to exit quite quickly
07:32 PM rue_mohr: hmm
07:32 PM rue_mohr: ok I'll dig for more errors
07:33 PM rue_mohr: I'v seen that error in mine too
07:33 PM rue_mohr: but if I re-run it usually doesn't
07:34 PM rue_mohr: oh wait
07:34 PM OK9UWU: yeah its weird
07:34 PM rue_mohr: I set the timeout wrong
07:34 PM rue_mohr: should be over 5000
07:34 PM rue_mohr: takes it a LOT longer to write than to read
07:34 PM rue_mohr: give that a go, I'll look for other errors
07:35 PM OK9UWU: bumping it up to 25k seems to work ha
07:35 PM rue_mohr: ouch
07:36 PM rue_mohr: hopefully a bit faster with that function
07:36 PM OK9UWU: houston, we have a success
07:36 PM rue_mohr: ok, so it was successfully
07:36 PM rue_mohr: ok
07:36 PM rue_mohr: I need to work on that
07:36 PM rue_mohr: SO
07:36 PM rue_mohr: reconnect with terminal
07:36 PM rue_mohr: commands to run the program are "AP 80" "GO"
07:36 PM OK9UWU: yeah it returns hello world
07:36 PM rue_mohr: :)
07:37 PM OK9UWU: wonderful!
07:37 PM rue_mohr: now take over the world with it, good luck :S
07:37 PM rue_mohr: haha
07:37 PM Tom_L: so now what?
07:38 PM OK9UWU: Gonna try some stuff, but i will really need to look more into the depths of MCUs to figure something out
07:38 PM rue_mohr: so, I need to rework the uploader/downloader with a state machine, cause that is stupid
07:38 PM OK9UWU: thanks however, off i go to hit the horizontal... its almost 3AM here
07:38 PM Tom_L: where is here?
07:38 PM rue_mohr: OK, I can help get the readchare working on your board too
07:38 PM OK9UWU: Central Europe, Czech Republic
07:39 PM Tom_L: is that pol's timezone?
07:39 PM OK9UWU: pol's?
07:39 PM OK9UWU: sorry my brain is running in slower mode already
07:39 PM Tom_L: polyprog
07:39 PM OK9UWU: oh
08:48 PM rue_mohr: asprintf