Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Jeremy Grosser
    @jeremy:synack.me
    [m]
    ah, good catch
    that does appear to fix it
    Daniel King
    @damaki:matrix.org
    [m]
    Awesome :)
    Jeremy Grosser
    @jeremy:synack.me
    [m]
    now I get 1.2 microseconds between the end of Transmit and CS going high
    Daniel King
    @damaki:matrix.org
    [m]
    That sounds like the software delay, and seems like a reasonable number
    Jeremy Grosser
    @jeremy:synack.me
    [m]
    yeah
    convenient, because the MAX7219 I'm testing with needs a few hundred nanoseconds after the last clock pulse anyway
    kinda interesting... I've got it set to 16-bit words and there's still a delay between every 8 bits it clocks out
    oh, no there isn't
    I was just reading it wrong, nevermind
    Jeremy Grosser
    @jeremy:synack.me
    [m]
    I added the check for BSY in Receive_Status too, but I'm pretty sure that only applies to slave mode, and I don't have an easy way to test that right now.
    Jeremy Grosser
    @jeremy:synack.me
    [m]
    looks like the UART had a similar bug
    I think the I2C driver is okay because the bus state has to go back to idle before it'll return
    Jeremy Grosser
    @jeremy:synack.me
    [m]
    if there's interest, I can cherry pick those commits out and tag a 1.0.1 release, or we can just go to 1.1.0... the recent interrupt changes are what make me think a minor version bump is warranted
    Jeremy Grosser
    @jeremy:synack.me
    [m]
    ok, I decided to just go ahead and tag 1.1.0
    afaik, the interrupt changes shouldn't break anything
    Jeremy Grosser
    @jeremy:synack.me
    [m]
    Jeremy Grosser
    @jeremy:synack.me
    [m]
    Today I learned about -fdelete-null-pointer-checks which is enabled by -O2 and -O3... It tries to delete any references to a null pointer and replace them with panic instructions. One of the things it thinks is a null pointer is any data or function with an address of 0x00000000. But I'm trying to read the ROM header, which is actually at 0. My code worked fine with -O0, but failed on undefined instructions when optimization was turned on. So we need -fno-delete-null-pointer-checks in order to tell gcc not to delete my code.
    that's ten hours of my life I'll never get back.
    Daniel King
    @damaki:matrix.org
    [m]
    Wow I didn't know about that
    Out of curiosity, how are you reading from address 0?
    Jeremy Grosser
    @jeremy:synack.me
    [m]
    a record type with Address => System'To_Address (0)
    Daniel King
    @damaki:matrix.org
    [m]
    That's how I would have done it too
    Jeremy Grosser
    @jeremy:synack.me
    [m]
    that's good, because it's basically your code
    Daniel King
    @damaki:matrix.org
    [m]
    Oh haha
    Jeremy Grosser
    @jeremy:synack.me
    [m]
    I'm getting the ROM floating point stuff working properly
    started with s-bootro.ad[sb] and have modified it heavily
    Daniel King
    @damaki:matrix.org
    [m]
    Are there problems with it? I did try some basic tests and it seemed to work
    Jeremy Grosser
    @jeremy:synack.me
    [m]
    not really problems, just trying to simplify things before I go and hook up the rest of the aeabi functions
    Daniel King
    @damaki:matrix.org
    [m]
    Ah ok
    I wonder why I never saw this crash when I tested it
    Jeremy Grosser
    @jeremy:synack.me
    [m]
    I figured out you can turn the Soft_Float_Table record into an access type and not have to cache all the pointers as separate variables
    Daniel King
    @damaki:matrix.org
    [m]
    Perhaps I had built the runtime at -O0
    Jeremy Grosser
    @jeremy:synack.me
    [m]
    GNAT also adds a bunch of extra flags when you're compiling a runtime
    Daniel King
    @damaki:matrix.org
    [m]
    Aha
    I'd be interested to see your changes when you've got them working
    Daniel King
    @damaki:matrix.org
    [m]
    Thanks
    Jeremy Grosser
    @jeremy:synack.me
    [m]
    look what I found in target_options.gpr for ravenscar: ADAFLAGS := ("-gnatg", "-nostdinc", "-fno-delete-null-pointer-checks");
    clearly I'm not the only one that's been bitten by this
    Daniel King
    @damaki:matrix.org
    [m]
    That explains why I never saw it :)
    And so I guess your changes would also work in the bb- runtimes
    Although, I only need to bind a few ROM functions
    I guess you're going to expose the rest of them?
    Jeremy Grosser
    @jeremy:synack.me
    [m]
    yeah, that's the plan
    I'm going to write representation clauses for the records too... makes me a bit uncomfortable to just assume the compiler is gonna pack things properly
    Daniel King
    @damaki:matrix.org
    [m]
    Good idea
    Jeremy Grosser
    @jeremy:synack.me
    [m]
    so this is weird... pico-sdk doesn't use the int2float function from the ROM, but I have no idea why
    https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2_common/pico_float/float_aeabi.S#L376
    looking at the bootrom implementation, I guess it introduces some rounding error? https://github.com/raspberrypi/pico-bootrom/blob/master/bootrom/mufplib.S#L358
    I don't know enough about floating point representations to really understand this