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

Complete mbed_retarget FileHandle rework #5571

Merged
merged 4 commits into from Feb 7, 2018

Conversation

@kjbracey-arm
Contributor

kjbracey-arm commented Nov 23, 2017

To complete the move to POSIX-ness and FileHandle-ness, close the loop by reworking mbed_retarget.cpp so that everything is a FileHandle.

This adds:

  • POSIX file APIs - open/close/read/write/lseek/isatty/fsync/fstat/fdopen/poll.
  • The ability to have buffered stdin/stdout using UARTSerial with a simple JSON change.
  • The ability for target or application to change stdin/stdout/stderr to be a custom FileHandle by overriding weak functions..
  • The option of CRLF conversion for any isatty() stream, not just stdin/stdout/stderr.
@kjbracey-arm

This comment has been minimized.

Contributor

kjbracey-arm commented Nov 23, 2017

@SeppoTakalo, @artokin, @geky, @sg-, @c1728p9, @pan-

This was prompted by #5356 - it achieves the same result in a more elegant fashion. The other reason for it is to make it easy to improve performance by making stdout be buffered, rather than spinning waiting for the serial port.

@kjbracey-arm

This comment has been minimized.

Contributor

kjbracey-arm commented Nov 23, 2017

FYI @tommikas

@kjbracey-arm kjbracey-arm force-pushed the kjbracey-arm:retarget_fh branch Nov 23, 2017

@kjbracey-arm kjbracey-arm force-pushed the kjbracey-arm:retarget_fh branch 8 times, most recently to 1a4f881 Nov 24, 2017

@TeroJaasko

This comment has been minimized.

Contributor

TeroJaasko commented Dec 20, 2017

+2. Overriding standard output is a recurring theme, recently there have been at least two PRs related to it. This PR would ease the effort on customer and remove need for patching Mbed OS locally.

@adbridge

This comment has been minimized.

Contributor

adbridge commented Dec 29, 2017

@sg- You may wish to take a look at this...

@bmcdonnell-ionx

This comment has been minimized.

Contributor

bmcdonnell-ionx commented Jan 2, 2018

I'm interested in stat(), fsync(), and fdatasync(), particularly for use with an SD Card (i.e. FATFileSystem on SDBlockDevice).

Is there a target mbed OS version # for having this completed and merged?

@SenRamakri SenRamakri requested review from geky, SenRamakri and 0xc0170 Jan 9, 2018

@cmonr cmonr requested a review from sg- Jan 12, 2018

@cmonr

This comment has been minimized.

Contributor

cmonr commented Jan 12, 2018

Adding @sg- as a reviewer, since he's also taken a look at #5356.

@kjbracey-arm, if I understand correctly, is this intended to supersede #5356, or complement it?

@geky

This comment has been minimized.

Member

geky commented Jan 12, 2018

Sorry I haven't been able to give this a good review yet. From a high-level it looks good though!

One big request: Would it be possible to add tests that check if we're at least retargeting these functions correctly? (A dummy filesystem that sets a flag might be the easiest method). This would also catch conflicting function definitions with the toolchains.

Making sure the retargeting stuff actually works on all of the toolchains is a big hole that may become a problem.

@kjbracey-arm

This comment has been minimized.

Contributor

kjbracey-arm commented Jan 15, 2018

@cmonr, yes, this would supersede #5356

@geky, yes I can look at some tests. (Not looked into what tests already exist yet.)

@kjbracey-arm kjbracey-arm force-pushed the kjbracey-arm:retarget_fh branch 2 times, most recently from bd0c523 to ccae00f Jan 17, 2018

@kjbracey-arm kjbracey-arm force-pushed the kjbracey-arm:retarget_fh branch from 26e489a to f79bfdd Feb 6, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Feb 6, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Feb 6, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci

This comment has been minimized.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Feb 6, 2018

/morph uvisor-test

@mbed-ci

This comment has been minimized.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Feb 6, 2018

/morph uvisor-test

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Feb 6, 2018

Locally tested this PR with #5895, green for all compilers (used k64f target)

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Feb 7, 2018

tests were integrated, restarting CI

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Feb 7, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@cmonr cmonr added ready for merge and removed needs: CI labels Feb 7, 2018

@theotherjimmy theotherjimmy merged commit 7b5d48d into ARMmbed:master Feb 7, 2018

20 checks passed

ARM mbed CI Verification build successful.
Details
AWS-CI uVisor Build & Test Success
Details
ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-test test completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
mbed-ci-generic Build finished.
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Local events testing has passed
Details
travis-ci/littlefs Local littlefs testing has passed
Details
travis-ci/mbed2-ATMEL Local mbed2-ATMEL testing has passed
Details
travis-ci/mbed2-MAXIM Local mbed2-MAXIM testing has passed
Details
travis-ci/mbed2-NORDIC Local mbed2-NORDIC testing has passed
Details
travis-ci/mbed2-NUVOTON Local mbed2-NUVOTON testing has passed
Details
travis-ci/mbed2-NXP Local mbed2-NXP testing has passed
Details
travis-ci/mbed2-RENESAS Local mbed2-RENESAS testing has passed
Details
travis-ci/mbed2-SILICON_LABS Local mbed2-SILICON_LABS testing has passed
Details
travis-ci/mbed2-STM Local mbed2-STM testing has passed
Details
travis-ci/tools Local tools testing has passed
Details

@kjbracey-arm kjbracey-arm deleted the kjbracey-arm:retarget_fh branch Feb 20, 2018

@RobMeades RobMeades referenced this pull request Jun 29, 2018

Closed

NULLs in SWO output #7373

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment