Git Product home page Git Product logo

Comments (11)

mos216 avatar mos216 commented on July 19, 2024 1

Hi Rob, after debugging it, I figured out that the stack size of the GNSS thread was small in the main file. after increasing the stack size everything started to work fine so far

but thank you for the explanation about using .map file , it was helpful

from ubxlib.

RobMeades avatar RobMeades commented on July 19, 2024

Apologies, I had forgotten the conversation we had only a week ago in #241 where it was clear that you are using LENA-R8 and trying to address the M10 GNSS chip inside the LENA-R8 module.

As indicated in my most recent post on #248, and as I think you have already concluded, for LENA-R8 it will be much simpler for you to access the internal GNSS chip via the dedicated/separate tx_gnss/rx_gnss pins provided on the module; while you could access the internal GNSS chip via the cellular device you would get into the problems we saw in #241 with UPOS interference and continuous location would, unfortunately, never work: it relies on a stream of data from the GNSS device, it can never work with the polled AT+UGUBX mechanism, which is the only way that LENA-R8 allows the AT (i.e. cellular) interface access to the internal GNSS chip. I will add a note to the main_loc_gnss_cell_continuous.c example that it will not work for a LENA-R8xxxM10 module to avoid further confusion.

So, to use continuous location with a GNSS chip connected via the TXD_GNSS/RXD_GNSS pins you would connect-up another UART of your MCU to those pins and then follow the main_loc_gnss_continuous.c example, i.e. the pattern for a dedicated GNSS device, not a GNSS chip inside a cellular module (i.e. we are ignoring the fact that it is inside the cellular module, it is just a GNSS device as far as ubxlib is concerned, the LENA-R8 HW is apparently designed to work that way). The device configuration you specify would be for a GNSS device and, in your Zephyr device configuration for the GNSS device, you would tell ubxlib to use the UART HW block that is connected to the TXD_GNSS/RXD_GNSS pins, baud rate as appropriate for the M10 device (which I think is probably 9600, the default, anyway, but please check).

Apologies that this is so confusing, it is just a peculiarity of LENA-R8 I'm afraid.

from ubxlib.

RobMeades avatar RobMeades commented on July 19, 2024

Documentation updated in commit addf595.

from ubxlib.

mos216 avatar mos216 commented on July 19, 2024

Hi Rob, thanks for explanation.

I tried to manipulate the gnss modem using tx_gnss/rx_gnss directly but no response. I see data on the tx_gnss of the modem by oscilloscope but it doesn't respond to the mcu host. it keeps sending positioning data after hot fix frequently seems like.

U_PORT_BOARD_CFG: using GNSS device "cfg-device-gnss" from the device tree, module-type 2 with pin-enable-power 38 (0x26), pin-data-ready -1 (0xffffffff)...
U_PORT_BOARD_CFG: ...GNSS on UART 1, uart-baud-rate 9600.
U_GNSS: initializing with ENABLE_POWER pin 38 (0x26), set to 1 to power on GNSS, transport type UART.
U_GNSS: sent command b5 62 0a 06 00 00 10 3a.
Opened device with return code -8.
Unable to bring up the device!

Do I need to enable something using AT command to get this one work. and is there a way to check which baudrate this device is working. I tried multiple baudrates but still no success.

from ubxlib.

RobMeades avatar RobMeades commented on July 19, 2024

Hmmm, I don't actually have a LENA-R8xxxM10 myself to try this out with.

Just to confirm, you have removed the uNetworkInterfaceUp(devHandle, U_NETWORK_TYPE_GNSS, &gNetworkCfg) line from your code; that would cause the cellular bit of the module to start talking to the GNSS chip and might confuse it.

As I'm sure you've read, the integration manual just says:

1.17.1 GNSS UART interface

LENA-R8001M10 modules supports a 1.8 V UART interface consisting of the RXD_GNSS data input line and the TXD_GNSS data output line, directly connected to the internal u-blox M10 GNSS chipset (as is illustrated in Figure 2).

The GNSS UART can be used as serial interface for direct communication between the internal u-blox M10 GNSS chipset and an external host.

The GNSS UART interface supports configurable baud rates. The default baud rate is 38,400 bit/s, with 8N1 (8 data bits, no parity, 1 stop bit) default frame format.

Neither handshaking signals nor hardware flow control signals are available in the UART interface.

Was 38,400 one of the baud rates you tried?

from ubxlib.

mos216 avatar mos216 commented on July 19, 2024

Hi Rob,

sorry is my bad. I didn't notice the default baud-rate in the integration manual.

But do we need to remove this line (uNetworkInterfaceUp) from Gnss initialization ? bc now with a standalone gnss, Cell and Gnss have their separate initialization functions, so ubxlib will have two instances, right?

Another question, since in Zephyr we are using dts , how can we specify which device (GNSS or CELL) has to be opened when calling uDeviceOpen, since the first parameter is null.

from ubxlib.

RobMeades avatar RobMeades commented on July 19, 2024

But do we need to remove this line (uNetworkInterfaceUp) from Gnss initialization ? bc now with a standalone gnss, Cell and Gnss have their separate initialization functions, so ubxlib will have two instances, right?

Apologies, I did not explain well: what I meant was to remove the uNetworkInterfaceUp() line for GNSS where the cellular handle is being passed in as devHandle. You should keep the uNetworkInterfaceUp() line for GNSS where the GNSS handle is being passed in.

Another question, since in Zephyr we are using dts , how can we specify which device (GNSS or CELL) has to be opened when calling uDeviceOpen, since the first parameter is null.

See fourth bullet point here: if you have both a cellular and a GNSS device in your device tree then you do need to have a uDeviceCfg_t structure that you pass to uDeviceOpen() but you only need to populate the uDeviceType_t member of that structure; with U_DEVICE_TYPE_CELL for the uDeviceCfg_t structure you pass when opening the cellular device and U_DEVICE_TYPE_GNSS for the uDeviceCfg_t structure you pass when opening the GNSS device.

Then the ubxlib code is able to tell which is which. A bit of a waste I know but it should be a const structure, so only a small waste of flash.

from ubxlib.

mos216 avatar mos216 commented on July 19, 2024

Hi Rob, thanks for the info and explanation.
I built a sample where first uDeviceOpen is called for CELL device and after that initializing mqtt stack and subscribing to a topic. In the same sample, I initialized GNSS as a separate modem, starting again with calling uDeviceOpen for GNSS (in the same sample), and after that calling uLocationGetContinuousStart for permanent looking for location fix. so afterwards we have a one sample where CeLL is subscribing to mqtt topic and gnss is working continuously for getlocation. However, when a message is published to the topic where cell is subscribing to, a message is received successfully but for somehow hardfault error occurs and crash the whole application. but when I stop gnss from looking for location, then everything works fine. Actually debugging this issue is little bit complex in zephyr bc a lot of routins participating behind scene and I'm not so much families how zephyr stack is implemented in ubxlib but there is a relation or some shared resources when two devices with different types are initialized in same firmware.
Could you guide me or give some hints for this issue?

here is the fault

[00:00:35.997,680] os: ***** USAGE FAULT *****
[00:00:35.997,711] os: Illegal load of EXC_RETURN into PC
[00:00:35.997,741] os: r0/a1: 0x00000002 r1/a2: 0x00050ddb r2/a3: 0xfffffffe
[00:00:35.997,741] os: r3/a4: 0x0099b000 r12/ip: 0x00054fb0 r14/lr: 0x00054fb1
[00:00:35.997,772] os: xpsr: 0x00027600
[00:00:35.997,772] os: s[ 0]: 0x000277c8 s[ 1]: 0x81000000 s[ 2]: 0x00000002 s[ 3]: 0x0004bf2d
[00:00:35.997,802] os: s[ 4]: 0x00000002 s[ 5]: 0x00052917 s[ 6]: 0x00000002 s[ 7]: 0x00050ddb
[00:00:35.997,802] os: s[ 8]: 0x00000002 s[ 9]: 0x00050687 s[10]: 0x0000000a s[11]: 0x00053d44

from ubxlib.

RobMeades avatar RobMeades commented on July 19, 2024

Replaying what you say above, the action of receiving an MQTT message causes a crash but that crash goes away if you don't call uLocationGetContinuousStart()?

there is a relation or some shared resources when two devices with different types are initialized in same firmware.

No, there is no relation between the two, they will be using different UARTs and completely different device instances. Provided you aren't doing very much from any callback functions you shouldn't have a stack problem as our default stack allocations are typically over-generous.

Obviously you now have two device handles, so it is worth checking that the right one is being passed to the right functions. Our general debug hints can be found here, but for your specific case I would start by looking in the .map file that your Zephyr build directory contains to see which function your program counter is in when the crash occurs. Only thing is, I can't see a program counter value in that dump of usage fault data, which is strange; was there anything else printed out after that?

I'm not familiar with the Zephyr usage fault information but I would guess that the s[] values are a stack dump and one or more of those values may be function addresses placed on the stack; not sure where you have RAM and flash mapped to but maybe you can tell which is which: for instance, is 0x000277c8 (the zeroth stack entry) in flash and, if so, can you see from the .map file which function it is in (i.e. search for 0x000277, or maybe 0x000276 in the .map file and see if you can narrow-down which function it might be in).

Going back to your description, I would ignore the fact that not calling uLocationGetContinuousStart() makes the problem go away, that could be a side-effect. If receiving an MQTT message causes a crash then you have a good, concrete, repeatable fault situation, which is very useful, concentrate on finding out as much about that as possible.

from ubxlib.

RobMeades avatar RobMeades commented on July 19, 2024

Excellent!

from ubxlib.

RobMeades avatar RobMeades commented on July 19, 2024

I will close this one now since this part, at least, seems to be working for you. Please feel free to re-open if that is not the case.

from ubxlib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.