Skip to content
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

[miniclient] align external repository for miniclient with feature branch #5726

Closed
wants to merge 30 commits into from
Closed

[miniclient] align external repository for miniclient with feature branch #5726

wants to merge 30 commits into from

Conversation

marcuschangarm
Copy link
Contributor

@marcuschangarm marcuschangarm commented Dec 18, 2017

This PR takes the external fork and aligns it with the miniclient feature branch.

These changes are not meant to be compatible with mbed-os/master but will find their way there through separate pull-requests once we are happy with the results.

Current changes include:

  • Enable flash on NRF52832.
  • Enable TRNG on NRF52832.
  • Fix pin names.
  • Enable second UART on NRF52840.
  • Experimental SWO debug output.
  • mbed Bootloader support and modified linker scripts.
  • alternative critical section for nanostack.

sarahmarshy and others added 23 commits December 18, 2017 13:41
functions in all projects to work properly.
mbed HAL API and NRF52 prototype implementation. Stdout can be
send to SWO using platform.swo-enable and serial can be disabled
using platform.stdio-enable.
- move swo init to SystemInit (in system_nrf52.c)
- add swo init code that resumes tracing after device reset
- change swo enable to use already existing macro name
The serial serial_free() tried to compare address of a member
of a struct, instead of the struct itself. This gives a warning
on GCC&ARMCC, but a error on IAR.

The fix here is not beautiful, a proper one would likely
avoid the memcpy() on serial_init() and have a proper way of
identifying the stdio-uart.

---8<---8<---8<---
Compile [100.0%]: serial_api.c
[Error] serial_api.c@382,0: [Pe042]: operand types are
incompatible ("serial_t *" and "struct serial_s *")
[ERROR]
          if(&stdio_uart == &(obj->serial))
The nanostack hal's critical section uses a mutex for mutual exclusion,
which is nice for many use cases. But when one needs to use the critical
section from interrupts, the RTX will have a assertion failure and panic.

Add a configurable for mbed_lib, which can be used to enable a alternative
version of critical section, which uses the underlying OS primitives, which
disables the interrupts.

Note: the default behavior is not changed, one needs to override the
"nanostack-hal.critical-section-usable-from-interrupt" to have "true".

Reason for this change is that there is a need for sending events using
nanostack event queue from interrupt context, eg. from a socket callback.
@marcuschangarm
Copy link
Contributor Author

@marcuschangarm marcuschangarm changed the title [miniclient] align external for with feature branch [miniclient] align external repository for miniclient with feature branch Dec 18, 2017
@yogpan01
Copy link
Contributor

@dannybenor FYI

@TeroJaasko
Copy link
Contributor

This PR passes at least my tests on K64F & NRF52_DK boards.

@kjbracey
Copy link
Contributor

The SWO-for-stdout implementation in here for mbed_retarget.cpp is a variant of a more-generic "alternate stdio retarget" proposal already put forward by #5356, to which I responded with an maximally-generic proposal in #5571.

(The submitter of #5356 then rewrote his example using #5571, which is a bit confusing for the history, but means it is now a good example implementation of it).

#5571 isn't currently making progress, but it should be borne in mind.

No need to do anything on your feature branch now, but if #5571 does go in to master, the conflict will need to be cleared up - you could instead do the SWO output without touching mbed_retarget.cpp by providing an mbed_override_console that returns an SWO FileHandle for stdout/stderr, like that SeggerRTT example.

Or if the SWO interface is thought to be generically-applicable enough, there could be a JSON option that to use the SWO FileHandle built-in to mbed_retarget.cpp, as for the existing serial.

@marcuschangarm
Copy link
Contributor Author

@kjbracey-arm thank you for the heads up!

My plan is to make a proper SWO HAL API using your redirect once it's been merged.

@mbed-ci
Copy link

mbed-ci commented Jan 17, 2018

Build : SUCCESS

Build number : 889
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5726/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build

@mbed-ci
Copy link

mbed-ci commented Jan 18, 2018

@mbed-ci
Copy link

mbed-ci commented Jan 18, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 18, 2018

The latest test results -flash tests fail (the addition here)

@yogpan01
Copy link
Contributor

@marcuschangarm Any update on this one ? We need to get this in otherwise we cannot move our development to mbedOS repo.

@cmonr
Copy link
Contributor

cmonr commented Jan 25, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Jan 25, 2018

Build : SUCCESS

Build number : 960
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5726/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build

@marcuschangarm
Copy link
Contributor Author

@yogpan01 sorry for the delay! I was a bit stumped by why enabling flash writes would suddenly deplete the heap! 😨

Let's see if this makes the CI happy!

@mbed-ci
Copy link

mbed-ci commented Jan 26, 2018

@mbed-ci
Copy link

mbed-ci commented Jan 26, 2018

@marcuschangarm
Copy link
Contributor Author

Great, now the NUCLEO_F746ZG fails!

@kjbracey
Copy link
Contributor

#5419 also is seeing spurious(?) fails on lp_ticker tests on Nucleo F401. Do we have a general problem on master?

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 26, 2018

#5419 also is seeing spurious(?) fails on lp_ticker tests on Nucleo F401. Do we have a general problem on master?

There was a patch few days ago, since then havent seen these. I would rebase to get the latest master in

@jeromecoutant

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 26, 2018

/morph test

@mbed-ci
Copy link

mbed-ci commented Jan 26, 2018

@cmonr
Copy link
Contributor

cmonr commented Jan 26, 2018

Please take a look at test around the NUCLEO_F746ZG with this PR. More specifically, low power timer test are failing.

@kjbracey
Copy link
Contributor

kjbracey commented Jan 29, 2018

I'm seeing low power tests failing on Nucleo boards on #5419. They seem spurious to me, or at least unrelated to either actual PR. Are they showing up more widely? Looks like either a precision problem or interrupt latency spikes.

(Ah, I did already comment above, and apparently there's a master patch. Let's both try rebasing).

@marcuschangarm
Copy link
Contributor Author

Subset of changes merged into new feature branch: https://github.com/ARMmbed/mbed-os/tree/feature-cloud-client-lite

@sg- sg- removed the needs: work label Feb 2, 2018
@marcuschangarm marcuschangarm deleted the feature-miniclient-align branch April 5, 2018 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.