Commit Graph

6077 Commits (0549b1e7c5f9db5abb1ecda7a1ebeb43f4aad19c)

Author SHA1 Message Date
Martin Kojtal c357216217 Add static ram/rom info
After a build has been completed print out ram and rom usage.
The sizes shown are the same as those reported by
arm-none-eabi-size.exe.  The output looks like:

Memory sections sizes:
text                 37244
data                 60
bss                  7800
2016-05-18 15:55:10 -05:00
Russ Butler e920f247bf Update mbed-client repos
Update the mbed-client repos to bring in the latest changes.  With
this PR the mbed-client repos now point to commits mirrored from
the real repo rather than a morpheus fork.
2016-05-18 09:42:59 -05:00
Sam Grove 3c08e7b7b3 Merge pull request #72 from ARMmbed/enable_irq
Restore IRQ status on exit; don't always enable
2016-05-18 08:52:02 -05:00
Kevin Bracey 640116123c Use critical section helper in HAL
Routines using __disable_irq and __enable_irq had the effect of
enabling interrupts if called with interrupts disabled.

Some versions of __disable_irq do not return old status to restore it.

Change to use the critical section helper functions instead.
2016-05-18 14:50:31 +03:00
Marcus Shawcroft c24e3e4178 Merge pull request #102 from adbridge/utest_namespace
Added full namespacing to instances of status_t to prevent namespace
2016-05-18 09:32:25 +01:00
Marcus Shawcroft d29c33e73e Merge pull request #100 from meriac/master
Updated to latest uvisor-mbed-lib version
2016-05-18 09:26:13 +01:00
Sam Grove 7d541a9cbd Merge pull request #104 from theotherjimmy/buffered-serial-printf
removed warning about unsigned to signed cast
2016-05-18 02:02:59 -05:00
Sam Grove f77d9e73ad Merge pull request #95 from screamerbg/master
Build system exclude folders containing .buildignore file
2016-05-18 01:59:56 -05:00
Bogdan Marinescu 7634adbf8c Merge pull request #105 from ARMmbed/revert-92-master
Revert "Adding configuration-store & flash-abstraction components for CFSTORE integration"
2016-05-17 23:21:18 +03:00
Bogdan Marinescu 09913f8859 Revert "Adding configuration-store & flash-abstraction components for CFSTORE integration" 2016-05-17 23:20:39 +03:00
Mihail Stoyanov faa9ce76af Removed fixes intended for different PR 2016-05-17 19:46:42 +01:00
Jimmy Brisson 59ed1bef61 removed warning about unsigned to signed cast 2016-05-17 13:35:24 -05:00
Milosch Meriac c5a5774b60 updated to latest uvisor-mbed-lib version 2016-05-17 18:27:27 +01:00
Anna Bridge 3de4514068 Added full namespacing to instances of status_t to prevent namespace
collisions with the same type in global C namespace.
2016-05-17 17:58:05 +01:00
Bogdan Marinescu a5800ef975 Merge pull request #92 from simonqhughes/master
Adding configuration-store & flash-abstraction components for CFSTORE integration
2016-05-17 18:53:14 +03:00
geky 6ccb19304d Merge pull request #99 from c1728p9/fix_ipv6_addr
Fix SocketAddress constructor to support ipv6
2016-05-17 10:46:23 -05:00
Simon Hughes aebc3f8433 Changing lib files:
- configuration-store.lib points to branch sdh_dev_mx2_20160513 of armmbed/configuration-store.git
- flash-abstraction.lib points to branch master of fork simonqhughes/flash-abstraction.git
2016-05-17 16:25:45 +01:00
Bogdan Marinescu 96b03b92a3 Added documentation for JSON target descriptions 2016-05-17 17:26:49 +03:00
Russ Butler 64cd1f3dfb Fix SocketAddress constructor to support ipv6
Fix typo causing ipv6 addresses in the constructor to fail.
2016-05-17 08:24:10 -05:00
Simon Hughes e812489000 New versions of configuration-store and flash-abstraction lib files restructuring mbedosV3 test into TESTS directories. 2016-05-17 11:10:22 +01:00
Christopher Haster 9ce315a18c Increase C027 buffers to handle DTLS packets 2016-05-17 04:06:03 -05:00
Bogdan Marinescu 7c57269dcf Moved target definitions to JSON format
(long commit message ahead. Sorry about that, it can't be helped.)

This commit changs targets definition from Python to JSON format, as
part of the configuration mechanism implementation. There is a new file
under tools/ called "targets.json" which contains the target
definitions. "targets.py" remains, but becomes a wrapper on top of
"targets.json", with the same interface as before. This has the
advantage of not requiring code changes outside "targets.py".

Most of the JSON definitions of targets were automatically generated by a
script (available upon request since it doesn't make a lot of sense to
include it here), only those targets that had more than one parent in
the Python implementation were converted by hand. The target definitions
should be pretty self-explanatory. A number of things are different in
the JSON implementation (this is just a summary, a separate commit that
documents how to write target definitions will follow later):

- "program_cycle_s" is now a value (as opposed to a function in the
Python implementation), since it only returned a number in all the
Python target implementations. The main definition that actually contains
some code (in class "Target") remains in target.py
- array values in "macros" and "extra_labels" can be modified
dynamically. Values can be added using "macros_add" and
"extra_labels_add" or removed using "macros_remove" and
"extra_labels_remove". This mechanism is available for all attributes
with a list type, but it's currently enabled only for "macros" and
"extra_labels" to keep things simple.
- "init_hooks"/"binary_hook" are now implemented in terms of a single
JSON key valled "post_binary_hook". The corresponding code is also in
"targets.py", under the various TargetCode classes (see for example
LPC4088Code in targets.py).

Just like in the Python implementation, a target can inherit from zero,
one or more targets. The resolution order for the target's attributes
follows the one used by the Python code (I used
http://makina-corpus.com/blog/metier/2014/python-tutorial-understanding-python-mro-class-search-path
as a reference for the implementation of resolution order).

This is obviously a very dangerous commit, since it affects all targets.
Unfortunately, since mbed-os only compiles for K64F, I didn't have many
chances to try to compile mbed-os with different targets. I did it for
K64F in different scenarios (pretending that it has hooks, for example),
but there's definitely a lot more to be done there. The threaded blinky
example for K64F compiles and works.

I tried to test in a different way: I wrote a script that imports the
old (Python) and the new (JSON) implementations and verifies that the
attributes in the old implementations exist and have the same values
in the new implementations (it also verifies that the attribute
resolution order is the same in the two implementations). If you're
interested, the script is here:

https://gist.github.com/bogdanm/4caf3a11613dcec834b05d5ab87c65dc

And the results of running the script are below (note that the script
outputs only the target names that were found to be problematic):

F51_MICROBIT_BOOT:
    Resolution order is different in old and new
        old: ['NRF51_MICROBIT_BOOT', 'MCU_NRF51_16K_BOOT_S110', 'MCU_NRF51_16K_BOOT_BASE', 'MCU_NRF51_16K_BASE', 'MCU_NRF51', 'Target', 'MCU_NRF51_S110']
        new: ['NRF51_MICROBIT_BOOT', 'MCU_NRF51_16K_BOOT_S110', 'MCU_NRF51_S110', 'MCU_NRF51_16K_BOOT_BASE', 'MCU_NRF51_16K_BASE', 'MCU_NRF51', 'Target']
    'extra_labels' has different values in old and new
        old: ['NORDIC', 'MCU_NRF51', 'MCU_NRF51822', 'MCU_NORDIC_16K', 'MCU_NRF51_16K', 'MCU_NRF51_16K_BOOT', 'MCU_NRF51_16K_S110', 'NRF51_MICROBIT']
        new: ['NORDIC', 'MCU_NRF51', 'MCU_NRF51822', 'MCU_NORDIC_16K', 'MCU_NRF51_16K', 'MCU_NRF51_16K_S110', 'MCU_NRF51_16K_BOOT', 'NRF51_MICROBIT']
    'macros' has different values in old and new
        old: ['NRF51', 'TARGET_NRF51822', 'TARGET_MCU_NORDIC_16K', 'TARGET_MCU_NRF51_16K', 'TARGET_MCU_NRF51_16K_BOOT', 'TARGET_OTA_ENABLED', 'TARGET_MCU_NRF51_16K_S110', 'TARGET_NRF51_MICROBIT', 'TARGET_NRF_LFCLK_RC']
        new: ['NRF51', 'TARGET_NRF51822', 'TARGET_MCU_NORDIC_16K', 'TARGET_MCU_NRF51_16K', 'TARGET_MCU_NRF51_16K_S110', 'TARGET_MCU_NRF51_16K_BOOT', 'TARGET_OTA_ENABLED', 'TARGET_NRF51_MICROBIT', 'TARGET_NRF_LFCLK_RC']
NRF51_MICROBIT:
    Resolution order is different in old and new
        old: ['NRF51_MICROBIT', 'MCU_NRF51_16K_S110', 'MCU_NRF51_16K_BASE', 'MCU_NRF51', 'Target', 'MCU_NRF51_S110']
        new: ['NRF51_MICROBIT', 'MCU_NRF51_16K_S110', 'MCU_NRF51_S110', 'MCU_NRF51_16K_BASE', 'MCU_NRF51', 'Target']
    'extra_labels' has different values in old and new
        old: ['NORDIC', 'MCU_NRF51', 'MCU_NRF51822', 'MCU_NORDIC_16K', 'MCU_NRF51_16K', 'MCU_NRF51_16K_S110']
        new: ['NORDIC', 'MCU_NRF51', 'MCU_NRF51822', 'MCU_NRF51_16K_S110', 'MCU_NORDIC_16K', 'MCU_NRF51_16K']
    'macros' has different values in old and new
        old: ['NRF51', 'TARGET_NRF51822', 'TARGET_MCU_NORDIC_16K', 'TARGET_MCU_NRF51_16K', 'TARGET_MCU_NRF51_16K_S110', 'TARGET_NRF_LFCLK_RC']
        new: ['NRF51', 'TARGET_NRF51822', 'TARGET_MCU_NRF51_16K_S110', 'TARGET_MCU_NORDIC_16K', 'TARGET_MCU_NRF51_16K', 'TARGET_NRF_LFCLK_RC']
NRF51_MICROBIT_OTA:
    Resolution order is different in old and new
        old: ['NRF51_MICROBIT_OTA', 'MCU_NRF51_16K_OTA_S110', 'MCU_NRF51_16K_OTA_BASE', 'MCU_NRF51_16K_BASE', 'MCU_NRF51', 'Target', 'MCU_NRF51_S110']
        new: ['NRF51_MICROBIT_OTA', 'MCU_NRF51_16K_OTA_S110', 'MCU_NRF51_S110', 'MCU_NRF51_16K_OTA_BASE', 'MCU_NRF51_16K_BASE', 'MCU_NRF51', 'Target']
    'extra_labels' has different values in old and new
        old: ['NORDIC', 'MCU_NRF51', 'MCU_NRF51822', 'MCU_NORDIC_16K', 'MCU_NRF51_16K', 'MCU_NRF51_16K_OTA', 'MCU_NRF51_16K_S110', 'NRF51_MICROBIT']
        new: ['NORDIC', 'MCU_NRF51', 'MCU_NRF51822', 'MCU_NORDIC_16K', 'MCU_NRF51_16K', 'MCU_NRF51_16K_S110', 'MCU_NRF51_16K_OTA', 'NRF51_MICROBIT']
    'macros' has different values in old and new
        old: ['NRF51', 'TARGET_NRF51822', 'TARGET_MCU_NORDIC_16K', 'TARGET_MCU_NRF51_16K', 'TARGET_MCU_NRF51_16K_OTA', 'TARGET_OTA_ENABLED', 'TARGET_MCU_NRF51_16K_S110', 'TARGET_NRF51_MICROBIT', 'TARGET_NRF_LFCLK_RC']
        new: ['NRF51', 'TARGET_NRF51822', 'TARGET_MCU_NORDIC_16K', 'TARGET_MCU_NRF51_16K', 'TARGET_MCU_NRF51_16K_S110', 'TARGET_MCU_NRF51_16K_OTA', 'TARGET_OTA_ENABLED', 'TARGET_NRF51_MICROBIT', 'TARGET_NRF_LFCLK_RC']
NOT OK: ['NRF51_MICROBIT', 'NRF51_MICROBIT_BOOT', 'NRF51_MICROBIT_OTA']

The reasons for the above output are subtle and related to the
extremely weird way in which we defined target data in the old
implementation: we used both class attributes and instance attributes.
This can complicate resolution order quite a bit and those two levels
don't exist in JSON: there's only one attribute type (equivalent to
Python's instance attributes). To make that work, I had to change the
inheritance order of the above targets (that use multiple inheritance)
which in turn changed the order of some macros and extra_labels (and of
course the resolution order). No harm done: the values are the same,
only their ordering is different. I don't believe this causes any
problems for 'extra_labels' and 'macros'.

This method of testing has its limitations though; in particular, it
can't test the hooks. I'm opened to ideas about how to test this better,
but I think that we need to remember that this commit might break some
targets and keep an eye out for "weird errors" in the future.
2016-05-17 11:34:02 +03:00
Christopher Haster 901dcbd893 Fix C027 endianness issue 2016-05-17 03:05:24 -05:00
Christopher Haster 88293b54f1 Fix idiosyncratic non-blocking behaviour in C027 2016-05-17 02:48:47 -05:00
Christopher Haster a878b60a0a Add background thread to emulate attach callback for C027 2016-05-17 01:22:53 -05:00
Christopher Haster 467a31f263 Add C027Interface 2016-05-17 01:22:52 -05:00
Christopher Haster 4f8e8f5d75 Add non-blocking support to ESP8266Interface
requires changes in the following
- BufferedSerial
- ESP8266
- ESP8266Interface
2016-05-16 20:40:57 -05:00
Christopher Haster 018e2571e6 Added other attributes on supported compilers
tested on GCC, Clang, online compiler, and IAR

attributes
- PACK
- ALIGN
- UNUSED
- WEAK
- PURE
- FORCEINLINE
- NORETURN
- UNREACHABLE
- DEPRECATED
2016-05-16 18:59:23 -05:00
Christopher Haster f05240b666 Added attribute tests from compiler-polyfill
from https://github.com/ARMmbed/compiler-polyfill/tree/master/test/attributes
2016-05-16 14:27:54 -05:00
Christopher Haster 8381fda624 Merged compiler-polyfill into toolchain.h
from https://github.com/armmbed/compiler-polyfill

notes
- Adopted existing mbed naming convention of all caps.
  This avoids conflicts with compiler declarations
  https://github.com/ARMmbed/compiler-polyfill/issues/7

- Dropped align attribute due to lack of support on IAR.

- Currently toolchain.h lives in /hal/api, although with
  the addition of /util there may be a better home.
2016-05-16 14:02:46 -05:00
Sam Grove cde78ec095 Merge pull request #94 from geky/callback
Improve FunctionPointer class
2016-05-16 10:24:47 -07:00
Christopher Haster dd6a24b76d Adopt Callback class in NetworkSocketAPI 2016-05-16 11:48:09 -05:00
Sam Grove b7cdc204fd Merge pull request #88 from geky/nsapi-changes
Update Network Socket API
2016-05-16 09:21:15 -07:00
Mihail Stoyanov b57fbf4c68 Exclude folders from build that contain .buildignore file (part of de-fork of mbed HAL+RTOS) 2016-05-16 13:06:54 +01:00
Russ Butler b15e2c293e Add synchronization to the network socket API
Add mutexes to protect the network socket API.  Also use semaphores to
wait for read/write events.  Also fix a typo in the comments for
timeout.
2016-05-15 18:03:48 -05:00
Russ Butler c8fc4dff6d Update Nanostack related libs
Update library files related to Nanostack to bring in Network Socket
API support.
2016-05-15 18:03:40 -05:00
Christopher Haster e1c42a3afc Adopt Callback class in rtos Threads 2016-05-13 19:07:45 -05:00
Christopher Haster 4984077d07 Adopt Callback class in hal 2016-05-13 19:07:45 -05:00
Christopher Haster bf498de127 Add backward compatiblity for FunctionPointer class using Callback
effectively:
typedef Callback<R(A)> FunctionPointerArg1<R,A>
typedef Callback<R()> FunctionPointerArg1<R,void>
typedef Callback<R()> FunctionPointer
typedef Callback<R()> event_callback_t
2016-05-13 19:07:45 -05:00
Christopher Haster 8b330ae8a6 Add callback tests 2016-05-13 19:07:45 -05:00
Christopher Haster 8e42a32d00 Add Callback, an improved FunctionPointer class
- Adopt C++11 style template arguments, requires rename to Callback
- Add constructor for C style callback functions
- Add constructor for Callbacks
- Add static function for passing to C style callbacks
2016-05-13 19:07:45 -05:00
Christopher Haster 83f65c0d3a Add rudimentary support for server side
mirrored from:
https://developer.mbed.org/teams/NetworkSocketAPI/code/LWIPInterface/
2016-05-13 11:41:20 -05:00
Christopher Haster 9e415df196 Match changes to NSAPI in LWIPInterface
mirrored from:
https://developer.mbed.org/teams/NetworkSocketAPI/code/LWIPInterface/
2016-05-13 11:41:19 -05:00
Christopher Haster 4684173778 Match changes to NSAPI in ESP8266Interface
mirrored from:
https://developer.mbed.org/teams/components/code/ESP8266Interface/
2016-05-13 11:41:18 -05:00
Christopher Haster 7d9b5e6f76 Small bug fixes
mirrored from:
https://developer.mbed.org/teams/NetworkSocketAPI/code/NetworkSocketAPI/

- Fix bug with SocketAddress init per @c1728p9
- Fix issue with not passing interface through accept call
- Fix port issue in SocketAddress constructor
2016-05-13 11:41:17 -05:00
Christopher Haster 8304124a63 Add NSAPI_ERROR_PARAMETER
per @c1728p9
2016-05-13 11:41:16 -05:00
Christopher Haster bcab0fcef5 Added WFI to save power in temporary polling implementation 2016-05-13 11:41:15 -05:00
Christopher Haster 5475dd0404 Consolidate set_timeout/set_blocking behaviour
- Avoids ambiguity when both are used
- Matches Python behaviour
2016-05-13 11:41:14 -05:00
Christopher Haster d17fa4faad Separate Stack/Interface concept into two distinct classes 2016-05-13 11:41:13 -05:00
Christopher Haster 49ba2be3a7 Add standardized stack options 2016-05-13 11:41:11 -05:00