Hi. I’m trying to use RAK interrupt example. I compiled/burned successfully the firmware to the RAK5010.
Debugging with J-Link RTT Viewer, the interrupt on Pin 16 NOT WORKING. Same issue I have in Espruino with this interrupt. (lis3dh acceleration sensor interrupt)
Hi, do you modify any code? Or just use the example? The example we test is ok. So if you just run it without any modification, twist it to trigger the interrupt. If you modify any, post the code, we will check.
rui_sensor_register_callback(sensor_on,sensor_off);
rui_init();
while(1)
{
//do your work here, then call rui_device_sleep(1) to sleep
//here run system work and do not modify
rui_running();
}
}
I modify nothing on the original code…
Interesting, even using Espruino I had issue using this interrupt. I’m beginner using RUI, I’m at testing the RUI platform.
I see. The interrupt threshold value in lis3dh.c is 2 and you need twist the board which trigger the interrupt. And I think you may be stuck in the communication with BG96. From you log, the AT+ QGPS = -1 means it runs abnormally. Please remove the Jlink, judge the state exchange via the led. After it starts ok, twist the board, you will find led off which means sleep. And then twist, it will on means wake up. But remember not twist continually, in view of the reaction of board.
Thanks. Followed your instructions, I had success once but I can’t reproduce the event again. At next attempts the device goes to sleep but don’t weakup, the led remains off…
The bg96/gps status should not influence this interrupt. The sensors are drived by NRF52840, I think…
The bg96 will not affect it. But the sleep and wake up include at communication with the BG96. If it is stuck, it will not work. You can change the code by the green LED on board, just test interrupt and ignore BG96:
RUI_GPIO_ST led;
uint8_t state = 0;
void test_lis3dh()
{
RUI_LOG_PRINTF(“enter!!!”);
if (wake_flag == 0)
{
state = 1;
rui_gpio_rw(RUI_IF_WRITE,&led,&state);
wake_flag = 1;
}
else
{
state = 0;
rui_gpio_rw(RUI_IF_WRITE,&led,&state);
wake_flag = 0;
}
led.pin_num = 12;
led.dir = RUI_GPIO_PIN_DIR_OUTPUT;
led.pull = RUI_GPIO_PIN_NOPULL;
rui_gpio_init(&led);
rui_sensor_register_callback(sensor_on,sensor_off);
rui_init();
while(1)
{
//do your work here, then call rui_device_sleep(1) to sleep
//here run system work and do not modify
rui_running();
}
OK. Pay attention to the Jlink. We find the piratic Jlink will make BG96 lose efficacy. So if I advise you use USB to communicate, though the log information is not enough
Hi nero (Du)
Q. If I don’t use Jlink, how can I debug my code ? I’m little bit confused about the debugging methods of my custom firmware. I try to use RUI compiler and nothing else (Espruino/Arduino/…) because RUI it’s native and universal for many RAK products what I want to test/use in the near future. I use Termite with USB connection now and have no debug info…
The problem is just about JLINK. The VCC on 5010 is for input from JLINK. Genuine JLINK will work OK. But pirated JLINK will make BG96 work abnormally. There is no any problem with genuine JLINK, that’s my suggestion.
That’s just a suggestion. However, we have a good solution for user. Print log via USB. You can refer to my code below. I start a timer to print log per 1s.:
void main(void)
{
//system init
rui_sensor_register_callback(sensor_on,sensor_off);
rui_init();
timer_init();
while(1)
{
//do your work here, then call rui_device_sleep(1) to sleep
//here run system work and do not modify
if (timer_flag == 1)
{
usb_log_printf(“This is from USB!!”);
//usb_log_printf(“This is %d”,a);
//usb_log_printf(“This is %f”,b);
timer_flag = 0;
}
rui_running();
Hi
I made the modifications what you Sir posted. My issue is with the RUI online compiler !
Witch of them are good to use ? I try both, but no success …
Hi, in fact, only copy below to your code. And call usb_log_printf in place what you want to print. I’m not clear the “check” you mention. #include <stdarg.h>
"I want to be one not smart user. I buy/instructions/ready to sell
Can your company offer this to me ?"
I am still confused. So what goals do you want? You want to build your own application? Or you want us help you build it? Or any other thing? If you are not good at code, tell us your idea. I will help you realize it.
Hi @magdoz59 The RUI compiler is up and running for EU and Asia(I can not test other locations ), so it can be a local problem at your location as the RUI is hosted on a cloud.