-
-
-
-
-
On,no! It seems like the BTN1 Pin is D9, Right or no?I found it from the PCB image
DCONFIG_NFCT_PINS_AS_GPIOS
Adding
'DEFINES+=-DCONFIG_NFCT_PINS_AS_GPIOS',
now...
But,had the same problem, stucked on LED1 (red led) ...Do you mass erase the flash memory before flashing the hex?
Yes, with
nrf5 mass_erase
for LEDs you would want to do pwm to dim them anyway?
Sorry I don't know, i am a freshman :-)
-
Thax @fanoush, I have tried
'BTN1' : { 'pin' : 'D9' }
and built along with 'make clean' always, but nothing changed, it stucked on LED1 (red led).
I also tried the minimal board file(without BTN1) as you mentioned before to delete the cmd as follow:#'default_console' : "EV_SERIAL1", # 'default_console_tx' : "D25", #'default_console_rx' : "D26", # 'default_console_baudrate' : "9600", 'bootloader' : 0,
But stucked on LED1 (red led) too except the green and blue led
-
I'm trying to add espruino to my new 9Axial nrf52832 board but failed.
It has one Switch,one BTN,9Axial(3Acceleration,3Gyroscope,3Magnetometer),8M spi flash,Battery...as the attachments photo
Perfect for playing with ;-)The same product on Aliexpress, for someone who is interested in it.
Nine Axis Motion Sensor
https://a.aliexpress.com/_mP4vpLzBuilt cmd: make -j BOARD=NewBoard_SDK12 RELEASE=1 USE_BOOTLOADER=1
I flashed the hex file via SWD tools, and the led progress as follow, when power on:
blue led (about 4s)... // LED3
green led (about 1s)... // LED2
red led (Always on)... // LED1
stucked??And i can't find the bluetooth advertising frome the new device, it stucked :(, please could give me some hints how to do next.
Thank you in advance for your helpfulnesshere is the board file(most frome puck.js):
import pinutils; info = { 'name' : "new board", 'link' : [ "http://www.espruino.com/PuckJS"; ], 'default_console' : "EV_SERIAL1", 'default_console_tx' : "D25", 'default_console_rx' : "D26", 'default_console_baudrate' : "9600", 'variables' : 2250, 'bootloader' : 1, 'binary_name' : 'espruino_%v_new_SDK12_SD30_SPIFLASH.hex', 'build' : { 'optimizeflags' : '-Os', 'libraries' : [ 'BLUETOOTH', ], 'makefile' : [ 'DEFINES+=-DHAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND=1', # Looks like proper production nRF52s had this issue 'DEFINES+=-DBLUETOOTH_NAME_PREFIX=\'"Better"\'', 'DFU_PRIVATE_KEY=targets/nrf5x_dfu/dfu_private_key.pem', 'DFU_SETTINGS=--application-version 0xff --hw-version 52 --sd-req 0x8C,0x91', 'NRF_SDK12=1' ] } }; chip = { 'part' : "NRF52832", 'family' : "NRF52", 'package' : "QFN48", 'ram' : 64, 'flash' : 512, 'speed' : 64, 'usart' : 1, 'spi' : 1, 'i2c' : 1, 'adc' : 1, 'dac' : 0, 'saved_code' : { 'address' : ((118 - 10) * 4096), 'page_size' : 4096, 'pages' : 10, 'flash_available' : 512 - ((31 + 8 + 2 + 10)*4) }, }; devices = { 'LED1' : { 'pin' : 'D19' }, # LED red 'LED2' : { 'pin' : 'D20' }, # LED green 'LED3' : { 'pin' : 'D21' }, [#LED](https://forum.espruino.com/search/?q=%23LED) blue 'SPEAKER' : { 'pin' : 'D4' }, 'BTN1' : { 'pin' : 'D9' } } def get_pins(): pins = pinutils.generate_pins(0,31) # 32 General Purpose I/O Pins. pinutils.findpin(pins, "PD19", True)["functions"]["ADC1_IN1"]=0; # LED red pinutils.findpin(pins, "PD20", True)["functions"]["ADC1_IN2"]=0; # LED green pinutils.findpin(pins, "PD21", True)["functions"]["ADC1_IN3"]=0; # LED blue pinutils.findpin(pins, "PD25", True)["functions"]["USART1_TX"]=0; pinutils.findpin(pins, "PD26", True)["functions"]["USART1_RX"]=0; # everything is non-5v tolerant for pin in pins: pin["functions"]["3.3"]=0; return pins
-
-
-
-
Just, wasted several precious hours on my own "firmware" #-D
@Gordon , you r right...
I tested later that the code worked finevar lengthStr = atob("Cmcu...DApOw==").length;require('Storage').write("abc.js",atob("Cmcu...DApOw=="),0,lengthStr);
So, the problem is front end...
Espruino is perfect! Always! -
thax!
Yes,i usedjswrap_encodeURIComponent
beforebtoa
base64 encode for those utf8 multibyte Symbol or characters, and userequire('Storage').write("abc.js",decodeURIComponent(atob("Cmcu...DApOw==")),0,1000);
write to the Storage.
use0,1000
for slicing as the file little big...
atob("Cmcu...DApOw==").length is no problem, i'll try to modify the espruino build -
jsfWriteFile seems to get the wrong dLen(data length), when i enter the code below, i have to encode the data with base64, for some reason(utf8 multibyte Symbol or characters ), some times the data encoded is larger than befor, as use atob(...) when writing to the Storage. for example, the data original is 1000 byte, base64 encoded is 1500 byte, so the question is if i use
require('Storage').write("abc.js",atob("Cmcu...DApOw=="),0,1000);
error returned:
Uncaught Error: Too much data for file size at line 1 col 5563
use
'require('Storage').write("abc.js",atob("Cmcu...DApOw=="),0,1500);'
worked fine, but the storage space is wasted a lot ... the final data after base64 decoded just needs 1000 byte :( -
@Gordon nice,
jsiConsolePrintf("%v ", hc);
can print the JsVar's full string, but i still can't get the full string for variable defined in c code :( , it seems like the functionjsvAsString()
only get 20 lengthJsVar *hc = jsvNewFromString('dsafsafsafdsafdsafdsafdsafdsfdsafsafsafdsfsafsafsafdsaf'); char *myStr = jsvAsString(hc); while(*myStr ){ ... myStr ++; }
-
I want to get the full string
dsafsafsafdsafdsafdsafdsafdsfdsafsafsafdsfsafsafsafdsaf
from JsVar string as follow, but the functionjsvAsString()
seems to make the string truncated short, any good way to solve the problem? useJsvStringIterator
iterator through the JsVar?
any simple way?
thax!JsVar *hc = jsvNewFromString('dsafsafsafdsafdsafdsafdsafdsfdsafsafsafdsfsafsafsafdsaf'); JsVar *pStr = jsvAsString(hc); jsiConsolePrintf("%s ", hc); jsiConsolePrintf("%s ", pStr);
-
Great!! @Gordon You just like a beacon in my mist! :)
I'm going to try -
-
I want to draw bitmap (buffer) data directly with inlineC and noticed that the method Graphics.drawImage() used the setPixel(...) to draw the bitmap (buffer) data at last in jswrap_graphics.c, but the method Graphics.drawString() is called
graphicsFillRect()
andgraphicsFillRectDevice
to draw and returnedreturn gfx->fillRect(gfx, (int)x1, (int)y1, (int)x2, (int)y2, col)
, Why this way? What's the difference between the two and which one is more efficient to draw bitmap data? -
I'm sorry, i'm late! @fanoush Thx for your reminder, i had a LENOVO HX03, and spent some time to learn stuff, flash, page, pipe etc... and tested your dsd6 init file ;-) worked fine, lots of help!
And i found a problem will brick my device when i used the following code on Webide's left sides:
require("Flash").read(1,'0x60400000')
The log:>>> Sending... index.js:92927 ---> "require(\"Flash\").read(1,'0x60400000')" index.js:92927 >>> Sent index.js:92927 BT> SEND ERROR: NotSupportedError: GATT operation failed for unknown reason. index.js:92927 BT> Disconnected (gattserverdisconnected)
As the address '0x60400000' is not exist, may be ??
Fortunately, the lower battery ;-) you know.
-
-
Hi!
I want to upload a file (big binary) to extranal Flash at a specific start address (0x0000...) in Web Ide, and i don't want do this with File Storage.
Can i use these apis just likerequire("Flash").write(data, addr)
andE.pipe(source, destination, options)
?Will this work?Can some one give how to do it?
thanks -
This function returns a memory-mapped String that points to the actual memory area in read-only memory, so it won't use up RAM...If you evaluate this string with eval, any functions contained in the String will keep their code stored in flash memory.
https://github.com/espruino/Espruino/blob/master/src/jswrap_storage.c#L92It seems that
require("Storage").read
actually accessing the data directly from flash in bangle with RAM less.
But,i saw the post https://forum.espruino.com/comments/15009857/Gordon
Sadly no, it has to load into RAM (at least at the moment) since the flash is external. It does it in the idle loop though so can make use of a bunch of execution stack and save using as much program memory.So, I confused about
require("Storage").read
RAM less or RAM moreAnother confusing thing is the returned data between
require("Storage").read
withA string of data
andrequire("Flash").read
withA Uint8Array of data
, whitch from extranal flash both.thx!
thax great work!