-
Notifications
You must be signed in to change notification settings - Fork 1.3k
nRF port improvements and pca10056 support #573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Otherwise we get the "recipe commences before first target" messsage.
It will include the mcu-specific header based on defines.
If softdevice is available and enabled the SD function will be used, otherwise use MCU registers.
|
I downloaded and build an image fpr the pca10056 SDK - It built fine and loaded. make BOARD=pca10056 SD=s140 I am not able to access the file system via ampy as I can for the feather52. |
|
I am fairly new to circuitpython so I wasn't aware of ampy, looks super useful, I was wondering how does one upload files to the flash fs :D As you can guess from this, I have not tested the flashfs, I needed it in the linker scripts or otherwise I got warnings from these lines: https://github.com/adafruit/circuitpython/blob/master/ports/nrf/boards/common.ld#L2 If you want me to, I can look into fixing the issues with ampy before this is merged, I think it will be a good way to learn some more about the inner workings of the code :) |
|
So to test things like BLE scanning do you just enter the commands into he REPL manually or put the script in "freeze" then rebuild?? Just curious how you are using it. I was able to manually execute a ble scan, but it's pretty painful ;-) I'm OK with merging it as is and getting ampy working later but I'll leave that up to you and others. |
|
I also verified that I can still build and load the feather52 and use ampy to load files to its FS. So no harm done!! |
|
I just enter REPL and type the code manually, indeed painful, so we need to get ampy working! Good that the other boards are not broken, but still would be nice to get it working on the pca10056, just to save ourselves some sanity. |
|
I'm ok merging this with ampy not working as long as the other boards are fine. I'll let @microbuilder do the review. |
|
After spending a few hours trying to see what was causing the issues, I'm still not entirely sure, it does seem like we are getting wrong data on UART, ampy was sending But in the uart fifo we got: (The really strange part is the "USBS", where the heck does that come from...) |
|
@arturo182 I've seen |
|
I see, that would point to the ATSAM chip used for the debug interface, I will try to connect a external USB to uart board and verify there. There's also this thread on Nordic's forums: https://devzone.nordicsemi.com/f/nordic-q-a/16721/pca10040-uart-problem I am running Linux Mint which is based on Ubuntu so that's why I might be getting similar problems, I tried another USB port and disabling auto-mount like the thread suggests but that didn't help. |
|
Yes, ampy works with external USB to UART board, so it seems to be something related to the debug interface chip on the DK. |
|
How did you connect the external USB to UART board? I'm still finding my way around this SDK board. BTW - I tried adding the ubluepy_eddystone.py and ble_scan.py (from feather52 examples) files to freeze and they do run on the pca10056. |
|
The board has all the useful functions written on the back silk. Connect RX to 0.08 and TX to 0.06 and problem solved. |
|
;-) amazing what you find when you turn the board over. Thanks. |
|
Nice! - ampy is working via the USB/UART cable! I was able to put a few files onto the board and execute them! |
|
just a heads up - Ive have had this happen twice now: |
microbuilder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll need to make a new version of the serial bootloader to test on the PCA10056 with S140, but other than some minor changes to make it easier to use the bootloader, this looks good to me as a starting point. Perhaps @tannewt has some further feedback, though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be larger? The linker script has _minimum_heap_size = 128K;, and there is plenty of free SRAM on this SoC for the heap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How much do you recommend?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A custom linker script would perhaps be better here, following the feather52 example, since we will need to use a modified version of the serial bootloader in addition to the J-Link. I guess we don't technically need the serial bootloader on the PCA10056 since it has an on board J-Link, but we can still test the serial bootloader as an option on this board until commercial modules are available with the final silicon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how to proceed, should I leave as is until a new bootloader is available?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't worry about it ... I'll put the new linker script in myself when I generate the custom bootloader, since I'm not sure of the exact sizes right now anyway. I've only built it against s132.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a ?= like this: SOFTDEV_VERSION ?= 2.0.1 will make it easier to override this from the command line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do!
|
While you are modifying the linker files, would it be worth making the File System larger for the PCA10056? I tried increasing it from 0x19000 to 0x40000 ( 100K -> 256K ) and it seems to be working fine. |
|
@jerryneedell can do! |
|
Testing this on the actual HW, and OUCH ... the core firmware file is HUGE! Running Running a similar command on the feather52 target with S132v2.0.0 ( I'll have to look at what's enabled and what isn't to compare, but that's a MASSIVE difference and doesn't take into account the internal file system, SoftDevice or bootloader. Unless the SD is included in that binary? I'll dig into what those numbers mean now, but ouch. :) UPDATE: Sorry, the difference is purely in the |
|
The |
|
For the nrf52840 the .ld files have the _minimum_heap_size set to 128K while the feather52 has this set to 0. That is adding a big area to the .bss. |
|
@jerryneedell Yeah, the heap and memory is managed differently, I noticed that after the fact. @arturo182 If you want to push the minor changes suggested earlier, I'll merge this in, and will work on getting bootloader support in a new PR since that will require some changes on my end? Basic REPL works fine, and we can make improvements from there to make sure internal file system support is stable, etc. |
|
@microbuilder I pushed the changes in the commit just before your comment. |
|
FWIW - I downloaded #573 and made build for the feather52 and PCA10056 - both appear to be functional. Tested SPI on both builds (mounted SD Card). quick I2C test on PCA10056 (MCP9808 temperature sensor OK) - executed ble_scan.py example on PC10056. |
microbuilder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems good for a first pass at nRF52840 support on the PCA10056. I'm OK with merging this in, and we can get to work on a serial bootloader and USB support, but this gets the ball rolling. Thanks for the hard work here!
As mentioned in #561, both Peripheral and Scanner are working