I'm just getting around to testing my MPW3 chip no...
# mpw-3-silicon
j
I'm just getting around to testing my MPW3 chip now. So if I understand correctly even if the gpio configuration passes, you aren't guaranteed to have working GPIO right? It is just determined by how many dependent/independent hold violations you have in a row? I am only getting io[37] working which makes sense given the hold violations. So I just need to keep testing chips until I get ones that has a good "pattern" of hold violations such that it can be accommodated for?
a
does the gpio config tool "pass" as in it completes, or does it say that the entire chain is passing?
j
passes as in it says the entire chain is passing
a
oh interesting
if you're getting inconsistency with the gpio config tool then you're likely getting the same inconsistency with actually configuring it
j
Yeah that makes sense
a
but theoretically (and for most of my tests) it seemed that if gpio config passed consistently, then actually configuring those gpio settings generally worked fine (after copying over the python file of dependent/independent violations produced by the gpio config)
j
Ok, thanks for the help. I'll try just turning down the voltage
I can consistently pass the sanity check at 1.45V but still never see anything on non io[37] pins
completely unmodified gpio_test.c and with my gpio_config_def.py in the same directory and on PYBFLASH
a
interesting
but io37 is doing exactly what you expect? (a square wave at some consistent frequency)
just as a sanity check •
gpio_config_data.c
is actually being generated based on your gpio_config_def.py and the gpio_config_io.py is unmodified? • when running the gpio_test, you're still manually setting the voltage while flashing right (maybe worth multimetering just to make sure)
j
Yes io37 is what I expect
I'm seeing the correct voltage on my scope as well as on the print during flashing
a
i see
yeah that's really strange then
although i'd imagine io0 should also work? since they're two separate chains
j
I need to take a look at io0 again, I think I was seeing a square wave but not logic level?
I thought io0 had some issues being set to management core output though
a
oh possibly yeah
what does your actual gpio config def look like
do the first couple of pins (37 36 35 etc) have dependent violations?
afaik the way gpio config works is by driving output pins using the mgmt core, so if that's working then gpio test not working is incredibly strange
did you try the
make sanity_check
target and does that work?
j
make sanity check works consistently
gpio_config_def.py
a
wait the first one is H_NONE?
j
that makes sense right?
a
oh wait yeah
and then what's youls
gpio_config_data.c
what's in there?
j
gpio_config_data.c
a
interesting, i get something else when i run make with your gpio_config_def.py
if you
make -B
does that change gpio_config_data.c?
this is what i'm getting w/ the same gpio_config_def.py and configuring everything as MGMT OUT
j
sorry i sent you an outdated one
I am also getting that
without -B
a
ah alright
that's really confusing then
the fact that sanity_check works really seems to suggest that it should be a compilation-related issue and not a hardware issue
j
does sanity check use the data.c from gpio_test dir or nucleo dir?
if I run it from the gpio_test dir i mean
a
from the gpio_test dir
j
I noticed sanity check print H_INDEPENDENT on every line regardless of what is in the def file
but i'm manually modified the def file and it failed just to see
a
i had that too, i believe that's a just bug in the printing code
j
ah ok
a
that... is really strange though
that it's not working
unless there's something particularly fucky with your caravel somehow
or that one particular die is just unlucky
j
i've tried some other dies but not at 1.45v so maybe i'll do that
a
it would be interesting to see if you find any dies where io[36] is INDEPENDENT
and whether those dies work for io[36] or if they still don't work, might reveal smth interesting
j
thanks for the help, i'll let you know what i find
I got one with io[36] independent (but the whole chain doesn't pass). I disabled every i/o except 37 and 36, and still only 37 works. I did a clean clone of the repo and everything. I think I agree with you that this must be a software issue on my end.
a
that's... incredibly weird
j
I did notice that my make check was failing on my initial tests on the chip I was testing last night though...
a
if you disable io37 in your config then does it stop working? that would prove whether the config is being loaded at all or not
j
I disabled all the low gpio pins and that fixed the make check though
a
is it possible the firmware on the nucleo board is mangled? or is it the latest copy of the micropython code from the repo
j
I just reflashed it today. I'm on 1.2.2
My hangup is that if the nucleo board is the problem how is it passing sanity checks and def file generation? I have another board I can try
a
if somehow the nucleo board was driving the pins while the caravel was also driving them
j
Maybe it could be my cross compiler?
a
that could cause that? the drive strength on the caravel is weak so you wouldn't notice if there was a driver conflict
where did you install the cross compiler from?
j
I build from source
on the repo linked in the caravel readme
a
interesting
j
I grabbed the multilib
a
I wonder if you weakly drive the io36 externally (3.3v thru a 5k resistor) whether that would reveal anything (i.e. whether the pin is being actively driven low vs just floating)
j
I can try that but i suspect it is floating just from the slight wiggle i see on it compared to io37 with my scope
a
a slight wiggle (at the same frequency) would be consistent with a weak driver fighting with a strong driver i think? or it could just be crosstalk from io37
j
I'll need to test this later, I don't have the equipment on hand
I think you're right though I zoomed in and it does look more like it could be multidriven
20231026_140232.jpg
when it's driven to low it looks like it settles more? io 36 is yellow 37 is green
they ground out at the same value, I just moved them apart for visibility
a
that almost looks like the high side is just left floating but the low side is driven
j
when the sanity check is running I see it get driven to logic levels, but I don't that happen when I just power on the board with gpio_test
io36 I mean
a
do you know what bit config sanity check uses for the ios
it could be different from that generated by io test
j
I think it copies the def.py to the board and then generates it on the board itself
errm maybe not
I tried copying the config_data.c from the nucleo directory into the gpio_test directory and commenting it out in the Makefile and same result
I also tried a new nucleo board with version 1.2.1 instead of 1.2.2
a
weird
j
Thanks for all the help I think I've taken enough of your time, I'll let you know if I ever figure this out
@Tim Edwards please let me know if there is something obvious i'm missing
t
To return to your original statement:
"So if I understand correctly even if the gpio configuration passes, you aren't guaranteed to have working GPIO right? It is just determined by how many dependent/independent hold violations you have in a row? I am only getting io[37] working which makes sense given the hold violations. So I just need to keep testing chips until I get ones that has a good "pattern" of hold violations such that it can be accommodated for?"
If you can pass configuration, then no, it's not absolutely guaranteed that you can have a working GPIO for your user project, but most of the time (95% of cases, maybe?) you can get the functionality you need for the user project, although sometimes it takes a bit of clever thinking about it. If you have too many dependent hold violations on a particular chip, then that chip becomes effectively unusable if you're trying to reach any GPIO toward the middle of the range. The first thing to do is to summarize what you have seen so far. (1) Do you have chips for which the GPIO calibration completes and passes? (2) Are you able to run a simple toggle test from management, configuring the GPIO according to the results of the calibration, and confirming that all I/O are toggling? (3) What is the target configuration for your user project? How many channels are you using, and which ones are inputs and which are outputs? (4) Have you run the I/O simulation script to confirm that your settings for the user project are valid?
j
Thanks for the reply! 1. I have a chip that consistently completes (passes all GPIO) calibration at 1.45 volts and passes the sanity check, however there are 10 dependent hold violations on the start of the low gpio side. 2. When I run the gpio_test toggle test I can only see io[37] toggling but nothing else. It seems like other pins can get pulled down to ground but don't get driven high. I have the correct gpio_config_def.py in the directory. 3. I haven't even tried to run my own code since I wasn't able to get the toggle test working. The minimum gpio I need is just io 14, 16, 23 which need to all be grounded, and then hopefully one other gpio (maybe 37) to bitbang some data out. Maybe this will just work with what I have now since it seems like I might be able to drive arbitrary gpio low. If I can get more gpio working there are more tests I can run. 4. What is the I/O simulation script? Is this different from 'make check'
t
The behavior reported in (2) there is not expected. If you can pass GPIO calibration then you should be able to see all the I/Os toggling (in the worst case, you might get intermittent behavior somewhere in the middle of the I/Os; That's when I go looking for another chip to test). This sounds like a failure to get the calibrated result compiled into the toggle test. If you can zip up your files and post them, I can take a look at what you're doing. I do have an alternative calibration method that is much faster and much simpler than the published one which you might want to try (I will have to dig it up and refresh my own memory on how to run it). The simulation script is
caravel_board/firmware/mpw2-5/gpio_config/gpio_config_simulator.py
. It is not directly accessible from a
make
target.
j
Ok I ran the simulator and I see 1000000000011 for every GPIO that is set to MGMT output and all 0s for the disabled ones. Is https://caravel-harness.readthedocs.io/en/latest/gpio.html this information relevant for MPW3, because that would seem to imply my output is disabled? Here is the firmware I am testing with. I'm was just trying to toggle the high gpio with the low gpio disabled.
t
Give me a ping tomorrow so I don't forget about this, because I don't have time to look into it tonight.
a
@Jesse Cirimelli-Low confusingly enough, the "gpio" refers to the single gpio pin connected directly to the mgmt and just labelled as gpio
t
@Jesse Cirimelli-Low: Your "simulator_output" shows every channel from 19 to 37 set to management output (correct for the toggle test), but nothing is being set for channels 0 to 18. . . Only zeros are going in. If the simulation reflects reality, then you should see toggling on GPIO 19 to 37 but not on GPIO 0 to 18 (which as I understand is not what you're seeing).
@Jesse Cirimelli-Low: I do see that
gpio_config_io()
is commented out in your
gpio_test.c
file. There is also a
reg_mprj_xfer = 1; while (reg_mprj_xfer == 1);
statement. The way it is written would work if there were no issues with caravel, but definitely will not work with MPW 2 to 5. The
gpio_config_io()
routine is the workaround for the hold violation problem.
j
I've tried with gpio_config_io comment and uncommented without seeing any change. What should reg_mprj_xfer look like for MPW3?
Does it matter if gpio_config_io() is before or after set_registers()?
t
It shouldn't matter because the program bypasses the registers and uses a bit-bang method, so the register values will stay put.
j
@Tim Edwards @Anish Thanks for all the help. Commenting out the reg_mprj_xfer got all the gpio working 👍
🎉 1