-
Hello,
I got a new MDBT42Q module from Raytac. I want to flash this with Espruino. I downloaded the espruino_1v96_puckjs_app.bin. Using USART, I am unable to program the device with Espruino.
We are using the program stm32loader.py (link) . However, the handshake never happens giving error
Can't init. Ensure BOOT0=1, BOOT1=0, and reset device
This is even though we are pressing the button when inserting the battery to let it go to boot loader mode.
Please help with the process of flashing Espruino into an MDBT42Q module.
Regards
-
-
-
Hi there,
So, if you have a require statement, you have to write the statement (or your code) on the right side of IDE and upload. This process downloads any dependency from the internet and uploads them correctly to the device. You will get a module not found error if you write a require statement in the REPL.
A typical program would then have an onInit() function and a save() statement at the end of file for persistence.
The modules are downloaded from https://github.com/espruino/EspruinoDocs/tree/master/devices
A typical program would look like this-clearWatch(); var wifi; var werr; let WIFI_NAME = 'something'; let WIFI_OPTIONS = { password: 'something' }; let w_conn = 0; function onInit() { console.log('here'); connWiFi().then(succ => { w_conn = 1; console.log('connected !'); digitalPulse(LED2, 1, 100); }, err => { werr = err; console.log('some error in wifi connection'); }); } function connWiFi() { let prom = new Promise((res, rej) => { wifi = require('EspruinoWiFi'); wifi.connect(WIFI_NAME, WIFI_OPTIONS, err => { if(err) rej(err); else res(1); }); }); return prom; } save();
-
-
-
-
I have an application where the Puck sends data through BLE write on another device.
To reduce power consumption even more, I tried turning off NRF by NRF.sleep() (The example here works https://github.com/espruino/EspruinoDocs/blob/master/puck/Puck.js%20Security.md#disable-bluetooth)However, when I modify the code to enable sleep after performing some action, the Puck lights up all 3 LEDs and my function does not work again. Here is a sample pseudo code -
var locked = 0;
setWatch(function(){
NRF.wake();
digitalPulse(LED2, 1, 50);
/*
do something here
*/
setTimeout(() => NRF.sleep(), 1000); // turns on all 3 LEDs briefly and resets.
}, BTN, {repeat:true, edge:"rising", debounce:50});Any suggestions why is this happening ?
So, both the modules, MDBT42Q and STM32** have ARM cortex M4 based processor. So I thought in Puck (essentially MDBT42Q itself), Espruino runs on this ARM cortex.
If I got you correctly, you are saying I could flash Espruino on the MDBT42Q with nRF52DK ?
Since you have already done so in Puck (MDBT42Q), can you please help me understand if this is the proper way indeed ? Or possibly use a Segger JTAG ?
Thanks.