-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error Setting Power Mode on MAX-M10S #125
Comments
Hi there: which one is returning U_GNSS_ERROR_NACK (-1025): I can't see why the first one would return an error but, for the second one, what you're passing into For that one what you probably meant was: uGnssPwrSetFlag The compiler should have issued an error, or at least a warning, about using the wrong |
uGnssPwrSetMode(gnssHandle, U_GNSS_PWR_SAVING_MODE_ON_OFF ) is returning the -1025. Thanks for flag setting issue, I'll fix that. |
Hmmm, not sure I can explain that. Exactly which M10 device is this? Here is a segment of log output from our test system running through setting the power saving modes in test
You might want to set uGnssSetUbxMessagePrint(gnssHandle, true) and capture the trace output to see if there is anything obvious in the UBX message exchange with the device. |
Here is the output:
|
Well, that is pretty clearly a NACK:
You could maybe add a call to uGnssInfoGetFirmwareVersionStr() with, say, a 256 byte buffer and print the [multi-string] buffer that comes back, just so that we could get the exact device version details? Or if you don't want to fiddle about with printing a multi-string buffer you could call uGnssGetVersions() instead and print the values in the structure that it populates. Is it possible that you have one of the flavours of GNSS device that doesn't support power saving? |
MAX-M10S |
I don't understand that FW version but the MAX-M10S should be fine since it is exactly the same device as we test with in the output I pasted-in above (GNSS device FW version 5.10). I have very occasionally seen GNSS devices return a NACK if they are hit with many power-saving related requests in succession: maybe it is a timing thing and somehow the device is not ready to accept the power saving mode change? For debug purposes, maybe try adding a delay before sending the power saving mode to see if that makes a difference? |
Sorry, did a %d instead of %s. |
So, we have the same GNSS device, same FW version. In our test we happen to set the power saving modes in the order 2, 1, 0: for debug purposes, maybe try setting mode 2 (U_GNSS_PWR_SAVING_MODE_CYCLIC_TRACKING) instead, or perhaps try setting the mode that the device is already in, just to see if those succeed? |
Same error. Any other thoughts? The device never enters sleep mode either. This is all the code up to changing the mode:
` |
Maybe, for some reason, the various timers that the GNSS device uses to govern the durations of the different power saving phases have somehow gone screwy, so it is unable to power save? Not that I can see how that would happen, but maybe call uGnssPwrGetTiming(), print out all of the values to see if they make sense, and maybe write these back again to be completely sure, correcting any that don't look sensible, with uGnssPwrSetTiming()? |
Here are the values: |
Those look OK to me. I'm not an expert in the GNSS device and/or HW, but I wonder if |
Another possibility: checking the integration manual, it says that RAM is erased during on/off power saving, restored from BBRAM on wake-up, with BBRAM maintained from VIO. The code in To debug if that has an impact, search u_gnss_pwr.c for all occurrences of |
V_BKUP was never connected because main power is never removed. Unless the internal circuitry disconnects By changing those occurrences, my uGnssPwrSetTiming() settings are now being saved between code updates: No change to the error code though. |
OK, so I will make the change to add the BBRAM layer to the CFG-VAL save operations, that makes sense, but still getting a NACK back for the request to enter on/off power saving I can't explain. I will see if I can find someone who knows more about this than I to give me some hint tomorrow. |
Thanks for all your help. Tomorrow will try supplying power to V_BKUP and see if it makes a difference. |
Writing to BBRAM also is now pushed to |
Hi again: did you get any further with the "NACK" issue? I have not found anyone here who is able to come up with a reason why you should get a NACK; I have shown them your schematic but that didn't raise any eyebrows. |
We have made a modification to the board to enable V_BKUP. Should have that tested by the end of the week to see if it makes a difference. |
I'm going to close this as I guess you have resolved your issues, or maybe this is not relevant any more, etc. Please re-open if there is more to discuss on this topic. |
We were able to connect V_BKUP to V_CC. However, the problem still remains: U_GNSS: sent command b5 62 06 8a 09 00 01 03 00 00 01 00 d0 20 02 90 01. |
@nautalert: apologies, just wanted to confirm that this is the same issue as it has been a little while now. Let me restate (and re-open) the issue, please let me know if any of my assumptions are incorrect.
FYI, breaking down the
...and we send the same message to a MAX-M10S chip in our test system, where the exchange looks like this:
...where the MAX-M10S chip reports the following version structure:
Hmph. |
Pretty much all other commands work but uGnssPwrSetMode(). uGnssPwrSetFlag() and uGnssPwrSetTiming() work fine. Initializing GPS... |
Purely as an experiment, could you try compiling EDIT: hmmm, actually, I think it was like that when [your colleague, I guess] originally raised this problem back in August 2023, we changed it to be both RAM and BBRAM after that. So that can't be it. |
FYI, find attached a complete log of our standard regression test of GNSS power saving, run to the MAX-M10S device over I2C, where you can see the command sent at line 11 is identical to what you are sending. I have already asked our positioning AE team why this might not be accepted by a GNSS device and everyone looked at me blankly (via Teams, but you get what I mean); we must be missing something here, some fact that is probably staring us collectively in the face. I will ask again... |
Making the change in u_gnss_private.h didn't help. |
No, didn't think it would. I am trying to find someone internally who has any idea how the problem you are seeing could ever occur. Out of interest, does this happen on more than one device, just in case it is something really crazy going wrong with one particular chip? |
It's happening on all chips. |
Any update on why this might be happening? |
Apologies, I will prod the experts again... |
The gentleman who knows what he's talking about has got back to me and there is a slim possibility: might you have enabled system BeuDou B1C (this is specifically B1C, not B1l) in the GNSS chip? He says that "PSM does not support BeiDou B1C"; BeiDou B1C seems to be in the default set for SAM-M10Q but it is not for MAX-M10S, you would have to have enabled it specifically. EDIT: FYI, this is buried in the integration manual, section 3.6.2, along with a potentially useful note about SBAS: |
What is the correct way to enable or disable these? |
Examples of how to do configuration using the For the system types, you want the configuration key IDs with
The exact key for Beidou B1C is missing in our list of key IDs (I will fix that) but, no matter, you can just write-in the key ID yourself as follows (this assuming you are just setting the key value in RAM):
...value taken from the interface manual, section 4.9.21: |
Update: you should probably replace |
D'oh, and of course you want a
|
You were correct that BeuDou B1C was set. Power mode is now able to be set correctly. Thank you for your help with this. |
Phew, my apologies that it took so long. I will add a note to the code somewhere about this in the hope that I remember this corner-case the next time someone asks. Will close this issue [again :-)] now: feel free to re-open it, or open a new one, if there is more to discuss. |
Getting position updates just fine but when I try to set the power mode, I'm getting a -1025 error returned.
Am I missing something in setup or is the M10 not supported in this way?
The text was updated successfully, but these errors were encountered: