-
OK so I'm thinking i change my linker file so that the last couple of pages in flash are reserved for saving. So right now in my linker my flash has an ORIGIN address that is incremented so it is just after the softdevice and it has a length that then goes to the end off flash to be used by my application.
How many pages (each page is 4096 bytes) should I reserve for Espruino at the end so I get full functionality?
Also in BOARDS.py would address by the address of the first page to be used to save? then flash_availialbe would be the total bytes of these save pages? also what is place_text_section?
so then jshflashcontainscode() would just check the first address of this flash to see that it has been written? any specific value or just check that it is not completly ereased?
and are you saying I dont actually have to implemtn jshSaveToFlash and load? I'm not sure how to compress ram etc..
thanks!
-Mike -
I am trying to implement some functions in jshardware.c
I want the save() functionality so I can save functions and variables and keep them when the device turns on. and then can use the onInit() functionality as well.
so I'm assuming to get this working I just need to implement the Flash functions in jshardware.c?
what exactly is jshSaveToFlash and jshLoadFromFlash supposed to do? I'm not really sure where or what the contents of JsVars is.
also how would you reccomend implementing jshFlashContainsCode()?
-Thanks
Mike -
for example:
1.) turn on board loaded with espruino_nrf52.hex, board starts advertising in jshinit().
2.) connect to board with smartphone
3.) send "digitalWrite(LED_1, 1);" using UART simulated over BLE
4.) LED_1 lights up.then extend this to sending entire scripts. (currently using nordics nRF Toolbox app and the UART module to send and receive data from espruino).
--My problem
currently this is kind of working.. i can send commands under 20 bytes no problem. but when i send a command like "function a() { 25; }" the chip hard fualts. also for some reason i cant send over ~36 bytes even though i implemented ble long write and not sure why...
I am pretending like I am using EV_SERIAL1 right now. just using pushIOCharEvent like normal and USARTkick.
just looking for some advice on how to make this work. any suggestions/tips? Maybe i have some misunderstanding about how espruino read and writes from the terminal and what it expects? any suggestions on source files that I should look at to get a better idea about this?
thanks,
Mike -
-
-
OK, my problem has been that after I compile system startup seems to work fine. It call SystemInit and this returns. Then it calls _start and the program crashes there before ever reaching main? Any clues about what could be going wrong here?
If I keep CFLAGS, LDFLAGS, ARCHFLAGS etc... the same as you have it works but once I start using flags from Nordics example makefiles the code breaks. but ive been wondering if the way im compiling/linking is causing this.
thanks,
Mike -
OK so you import your devices library, write BOARD.py, modify the makefile and build_linker.py, and then implement jshardware.c / main.c. Finally you get it to compile for your board and it doesn't work at all. What now? How do you recommend troubleshooting/debugging espruino? What are some small steps I can break debugging into? (All im trying to do at this point is get my board talking to Espruino's web ide).
-
-
now looking at espruino_1v79...nrf52832dk.lst I am seeing that everything looks normal in terms of the different sections and their memory except for .bss. .bss size is 89052 bytes.
for the stm32f4discovery it is 91kb.
right now I only have 32kb of RAM to work with total. Where can i reduce this memory useage? what are the tradeoffs? it doesnt look like stm sets memory aside for the stack or heap?
-
hey so after changing the linker script to target nrf52 im finally getting PASS - size of 153676 is under 436224 bytes. the problem is I had to tell the linker script I have more RAM than i actually do to get this to happen.
I was getting espruino...nrf52.elf section ".bss" will not fit in region "RAM" - region "RAM" overflowed with stack -region "RAM" overflowed by 24692 bytes
when I had the actual amount of RAM in nrf52832.py. The board has 64kb of RAM and I have things like GRAPHICS, USE_NET etc.. disabled. Any idea of what could be going on? right now i think it may still be a problem in linker script but wanted to see what you think.
thanks, Mike
-
-
-
OK,
I have serial IO going and working with the terminal through COM port. The way I do this is implementing non blocking UART on nRF52 and going through an interface MCU on dev board that is seen as USB CDC by computer.
But now I need to integrate this into Espruino and not sure how to do that. Would I initialize UART in jshInit()? Im confused about how to get the bytes I read from terminal to Espruino and how to have Espruino write to terminal. Where does this happen?
Also is jshardware.c and main.c and BOARD.py the only files I need to create? Then just add all libraries i need in targetlibs/target/lib and then modify makefile? What other files/documentation should I be looking at for reference?
Last Im alittle confused about the Devices. Im guessing just specify UART as a device in BOARD.py and select default console as EV_Serial1? And then I wouldnt need to do any USB defines in the Makefile.
Thanks!
-
Im working on getting Espruino up and running the nRF52832 (ble enabled ARM Cortex M4F) SoC dev board. I forked the github repo and after reading around Im planning on doing the following.
- Edit the Makefile
- Create boards/nrf52832.py
- Create boards/pins/nrf52832.csv
- Add files from Nordics SDK to targets/lib/nrf52832
- Create the file jshardware.c in targets/nrf52832
Am I on the right track/any tips?
Appreciate the help!
-Mike - Edit the Makefile
-
Problem was here in the quickstart tutorial.
Windows 8.1 and XP Users: Windows XP and 8.1 do not appear to have generic drivers for USB CDC devices, so you'll have to get them from ST via st.com/web/en/catalog/tools/PF257938. You'll have to unzip the file, run the executable, and then go to C:\Program Files (x86)\STMicroelectronics\Software\Virtual comport driver in Windows Explorer and double-click either dpinst_amd64.exe for 64 bit systems, or dpinst_x86.exe for 32 bit.
Just needed to do the last step and double click dpinst_amd64.exe for 64 bit systems
-
-
-
I got a new stm32f4discovery board. I followed the quick start and other boards directions and successfully installed espruino on it through st-link utility. When I press the reset button the led right next to it flashes quickly which I read means espruino is properly programmed and running.
Now when I go to the espruino web IDE I can connect to the COM port and then when I try to type in the terminal nothing happens. If I press a key nothing shows up in the line or anything.
Any ideas on whats going wrong?
-Mike
Working on my port to the nRF52 and trying to get Flash to work. I want to be able to save() and load() code etc...
I've been having some problems and now that I'm using the Flash module I can kind of debug them. When I call Flash.erasePage(0x0); Espruino basically stalls out (but when I read flash memory through nrfjprog.exe it does look like the page was actually erased). It doesnt print anything else after that and the terminal looks like it just freezes. I can't even hard reset the board after it.
I kind of have a theory: whenever you do a flash operation with nRF5x devices the non-volatile memory controller takes control and does it for you. (you just configure it for read or write, pass it the address (and value) and then wait for it to finish). However it halts the CPU while it is doing this. Could this be causing the problem I'm seeing? Any work arounds or other ideas about the issue? I think same issue happens when I try to save() and load() code. Espruino just freezes