Interfacing with the new nRF52832 development kit #779
Replies: 11 comments
-
Posted at 2015-07-16 by @gfwilliams Hi Mike, Great, i'd be really interested to see how you get on. Yes, that sounds spot on. Instead of using the CSV, you can also hard-code pins in the python file, see here and here The csv files are really when you've got different peripherals on different pins (and Espruino has to know which is which), but it's possible the NRF52832 works differently anyway. For starters I'd totally forget about implementing the GPIO, I2C and SPI, and focus on hacking up serial IO so you can talk to the interpreter. From then on, life gets a lot easier. Note right now I've just merged the new STM32 USB changes, and on other targets you'll need to call |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-07-22 by mjdietz 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! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-07-22 by @gfwilliams
Yes, however I'd add the code in You'd then want to call that from
When you get a character from the UART (ideally this would be in an interrupt), you want to call: Ideally, for transmit you'd add code to
But, as kind of a stopgap you can do:
The issue with doing it from idle is really that if Espruino is busy, it's not going to be sending any data - it'd be relatively easy to crash it just by printing a load of data.
Yes, that should be about it... Potentially you may need to modify
There's not much apart from README.md I'm afraid. Best to look at what's done in the Makefile for other classes of device. For how to implement the contents of jshardware, the stm32 implementation is best, but the linux one might be handy too, as it's a bit higher level than the hardware-level stuff in stm32.
Espruino's got two queues, and input one where IRQs deposit info for the interpreter ( To make matters more confusing you've also got the ... and in the Board.py file, if that's what you actually mean? Devices there is mainly for the benefit of the pinout diagram, although it's used to set the constant for LED1/LED2/BTN1/etc - as well as to automatically configure things like SD cards if they're specified.
Yes, set the default console as Serial1. You shouldn't have to put anything in Hope that helps! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-07-22 by mjdietz OK thank you, this clears a lot up for me! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-07-27 by mjdietz OK so Ive done everything we talked about and it looks like it could work. I got everything to compile and generate espruino_1v79.119_nrf52832.bin but it is empty. I get the message PASS - size of 0 is under 436224 bytes. Any idea what could be causing this? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-07-27 by @gfwilliams There's a script called |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-07-29 by mjdietz 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 |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-07-29 by mjdietz 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? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-07-29 by mjdietz figured out the problem. I changed variables in BOARDS.py from ~5000 to 512. Now it is compiling successfully |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-07-29 by DrAzzy Well that'd do it! Once you get it working, you can nudge that up. JSVars are 16 bytes each, so you can definitely get more (though you do need to leave space for the stack) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-08-03 by @gfwilliams Great, glad you got it sorted! Also, if you stick at 1022 vars or below, Espruino can get away with using 12 bytes for each variable instead. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2015-07-16 by mjdietz
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.
Am I on the right track/any tips?
Appreciate the help!
-Mike
Beta Was this translation helpful? Give feedback.
All reactions