RAKWireless / RAK5205-WisTrio-LoRa

RAK5205-WisTrio-LoRa :GPS ,BME680,LIS3DH,LoRaWAN1.0.2,ARM Cortex-M3 STM32L1
9 stars 6 forks source link

LIS3DH no ACK and BME sensor last FW version not working. 2.x.0.3 #5

Closed RobMBSos closed 5 years ago

RobMBSos commented 5 years ago

I have made some GPS modification via KEIL and used last src code you have here at github but sensor, BME is not working. At serial interface it is saying: RAK5205_TrackerBoard software version:2.1.0.3

LIS3DH no ack

LIS3DH is not found!

BME I2C WRITE ERROR

BME set regs ERROR

BME soft reset ERROR

BME680 Init ERROR

Please Configurate parameters...

Regards! EDIT: using your source code doesnt't work too. Uncommented */

define LORA_HF_BOARD

define TRACKERBOARD

and it is still using LF version no creating HF for EU.

RobMBSos commented 5 years ago

Using .bin from RAK github is working, but using Keil Project and making hex file don't.

afremont commented 5 years ago

Do you have LORA_HF_BOARD defined? Without that, it will assign the wrong pins to SCL and SDA. This would explain all the I2C devices not working. It is not defined by default, anywhere so I guess you'd need to add a -DLORA_HF_BOARD to the gcc command line.

EDIT: It appears that it is defined, but commented out, in main.c, sorry about that. Seems like it would need to be defined at a higher level than that though, since it is referenced in so many source files.

RobMBSos commented 5 years ago

Hi @afremont! Thanks for taking your time responding, I already uncommented main.c but as you said it is not working, I am not a Keil expert so I do not know how to add gcc line, could you help me? Thanks! @RAKWireless any answer?

afremont commented 5 years ago

I don't happen to have Keil, but this might help you: http://www.keil.com/support/man/docs/uv4/uv4_dg_adscc.htm

It explains how to add "defines" to the compiler command line. It took me quite a while to find the place to do it in Eclipse. I have run into a problem that I can't resolve now. I'm getting a compile error when it tries to compile "LoRaWAN/master/system/gps.c" module. It definitely appears that there is a syntax error in the program that can't be fixed without changing the source file. This makes me worry that the github files may not match what is in the binary firmware files. The undefined variable is defined in "driver/lis3dh.c", but there is no way to pass that to gps.c. The undefined item is LIS3DH_ODR_FREQ.

RobMBSos commented 5 years ago

It was as you said, in Keil you have to go to Project - > Option for target Rak811 -> C/C++ tab -> In preprocessor Symbols -> define: HAL_IWDG_MODULE_ENABLED, LORA_HF_BOARD You build project, burn firmware and everything is working.

afremont commented 5 years ago

Are those the only two symbols defined there? Since I don't have Keil, I'm having to guess at what defines I need to use for setting up the project in Eclipse. I'd appreciate it if you could answer me on this.

RobMBSos commented 5 years ago

Hi @afremont! Yes are the only two symbols, nothing else added. It still creates LF_board.axf file but in reality is HF and it works. I will try to look more info using on Eclipse but in rak forum I saw something about them with WisTrio only using Keil as a IDE. image