Commit Graph

6055 Commits (c2e3001739cd91e79c3d3874678a8714b0c075d1)

Author SHA1 Message Date
Bartosz Szczepanski 82d82d0b2a [NUCLEO_F070RB] 16-bit timer register update
This path fixes issue #816.

Current value of TIM_MST->CNT is read in interrupt context only.
This avoids master timer overflow without SlaveCounter update.

Change-Id: Iaaf7b9eb33aa8d8992e9354ca5e21bf01ec2413d
2016-05-23 16:02:25 +02:00
Rafal Kula e938780788 [NUCLEO_F103RB] 16-bit timer register update
This path fixes issue #816.

Current value of TIM_MST->CNT is read in interrupt context only.
This avoids master timer overflow without SlaveCounter update.

Change-Id: Ie7a9bfce76990f85caa84264450d053604af33e5
2016-05-23 16:02:25 +02:00
Rafal Kula 07b841b08f [STM32Fxxx] Fix issue #816
Both STM32F0xx and STM32F1xx are using a 16-bit timer as a internal ticker
but the mBed ticker needs a 32-bit timer implementation, so the upper part
of that 32-bit timer is being calculated in software.

Software bug has been fixed where continous HIGH/LOW voltage levels
could be observerd for 65ms due to 16-bit timer overflow.

Now current value of TIM_MST->CNT is stored in cnt_val and is
updated in interrupt context only. This avoids master timer
overflow without SlaveCounter update.

This fix is only for platforms which already implements a 16-bit timer:
F103RB, F070RB, F030R8

Change-Id: I205c70ce155b373c6593ead93ade9ec38993f7f9
2016-05-23 16:02:25 +02:00
Bartosz Szczepanski f1c42bfc69 [NUCLEO_F302R8] Added CAN support
Added CAN API support for NUCLEO_F302R8 target.

*stm32f302x8.h* file was changed to avoid compilation errors.

Change-Id: Ia4ee8a90fe3f0ad6955dde21e78ea4a6c05e4fcd
2016-05-23 15:55:00 +02:00
Bartosz Szczepanski 347a5e629d [NUCLEO_F303K8] Added CAN support
Added CAN API support for NUCLEO_F303K8 target.

*stm32f303x8.h* file was changed to avoid compilation errors.

Change-Id: If093c84f19c5a5ef68938af4653a25271c1108ba
2016-05-23 15:55:00 +02:00
Bartosz Szczepanski 9a78b010a0 [NUCLEO_F303RE] Added CAN support
Added CAN API support for NUCLEO_F303RE target.

*stm32f303xe.h* file was changed to avoid compilation errors.

Change-Id: Ia6519c982261d43165dbce73cab7cfc0617474e2
2016-05-23 15:55:00 +02:00
Bartosz Szczepanski 656d1953d9 [NUCLEO_F334R8] Added CAN support
Added CAN API support for NUCLEO_F334R8 target.

*stm32f334x8.h* file was changed to avoid compilation errors.

Change-Id: Ic7b3273ffe24940ecdc189d2566a6a7f66825ce6
2016-05-23 15:55:00 +02:00
0xc0170 f74fc12313 Merge branch 'bcostm-fix_f4_serial' 2016-05-23 14:09:29 +01:00
0xc0170 ee6f510ade Merge branch 'fix_f4_serial' of https://github.com/bcostm/mbed into bcostm-fix_f4_serial 2016-05-23 14:08:19 +01:00
0xc0170 6523d648bf Merge branch 'BartSX-timer-l0-#816' 2016-05-23 14:03:42 +01:00
0xc0170 2b44bfbcc6 Merge branch 'timer-l0-#816' of https://github.com/BartSX/mbed into BartSX-timer-l0-#816 2016-05-23 13:59:40 +01:00
Bartosz Szczepanski 78767491f7 Added CAN API for STM32F3xx family
* STM32F3xx family have only one CAN bus

Change-Id: Icaed8ff8ca4a68ebbf2c124655e7368423fb71cd
2016-05-23 14:39:51 +02:00
0xc0170 57c85c034b Merge branch 'adustm-master' 2016-05-23 11:55:15 +01:00
0xc0170 369841a6cb Merge branch 'master' of https://github.com/adustm/mbed into adustm-master
Conflicts:
	workspace_tools/tests.py
2016-05-23 11:10:03 +01:00
0xc0170 821c492eb8 Merge branch 'neilt6-master' 2016-05-23 10:47:30 +01:00
0xc0170 327bd41632 Merge branch 'master' of https://github.com/neilt6/mbed into neilt6-master 2016-05-23 10:41:32 +01:00
0xc0170 275100e969 Merge branch 'BartSX-can-devel-f0' 2016-05-23 10:37:39 +01:00
0xc0170 c70aedc044 Merge branch 'can-devel-f0' of https://github.com/BartSX/mbed into BartSX-can-devel-f0 2016-05-23 10:37:22 +01:00
Martin Kojtal 99fb83ae21 Merge pull request #1730 from 0xc0170/dev_rtos_init
RTX - init sequence (C++ array init)
2016-05-23 09:58:08 +01:00
0xc0170 daf5c9ee86 RTX - ARM7 init sequence update 2016-05-23 09:50:24 +01:00
0xc0170 f3e11eb36e semihost - fix inline __semihost for IAR (add static)
This was causing errors at my machine (for programs like MBED_10, RTOS_1):

Error[Li005]: no definition for "__semihost" [referenced from
          semihost_api.o(mbed.a)]
[ERROR] Error[Li005]: no definition for "__semihost" [referenced from
          semihost_api.o(mbed.a)]
2016-05-23 09:50:20 +01:00
0xc0170 607c9d119b RTX - ARMCC pre_main - pop fix 2016-05-23 09:50:16 +01:00
0xc0170 8420e13246 RTX - pre_main for GCC C function 2016-05-23 09:50:11 +01:00
Martin Kojtal 230be00443 ARMCC ulib - initalize RTOS before the standard library C++ init
Initialize the RTOS before initializing the standard library.  This
allows C++ constructors to be called in a well defined thread context.
2016-05-23 09:50:05 +01:00
Russ Butler 87176751a8 IAR - Initialize RTOS before standard library
Initialize the RTOS before initializing the standard library.  This
allows C++ constructors to be called in a well defined thread context.
2016-05-23 09:50:00 +01:00
Russ Butler a5ace8dea0 GCC - Initialize RTOS before standard library
Initialize the RTOS before initializing the standard library.  This
allows C++ constructors to be called in a well defined thread context.
2016-05-23 09:49:55 +01:00
Russ Butler ac727e270e ARMCC - Initialize RTOS before standard library
Initialize the RTOS before initializing the standard library.  This
allows C++ constructors to be called in a well defined thread context.
2016-05-23 09:49:48 +01:00
Russ Butler a0fd520408 Remove dead CodeSourcery init code
The CodeSourcery compiler is not longer supported.  This patch removes
the CodeSourcery init code in RTX_CM_lib.h.
2016-05-23 09:49:44 +01:00
Martin Kojtal 03d8ea8e96 Merge pull request #1744 from screamerbg/simplify-layout
Simplify mbed SDK layout
2016-05-23 09:31:27 +01:00
Mihail Stoyanov ec8512aaab Removed mbed-drivers/mbed.h which breaks compatibility with binary releases due to difference in the inclusion path 2016-05-23 09:14:06 +01:00
Mihail Stoyanov 9db0f2e6e0 Update synch.py script to use the paths defined in paths.py 2016-05-23 09:14:04 +01:00
Mihail Stoyanov d5ad8cb949 Rename .mbedignore to .buildignore 2016-05-23 09:14:03 +01:00
Mihail Stoyanov 9bd2b4e4b1 Align paths config (paths.py) with the new directory layout. Also rename the output build folder to .build 2016-05-23 09:14:01 +01:00
Mihail Stoyanov d9734e5a32 Simplify layout:
* /libraries/mbed -> /hal
* /libraries/rtos -> /rtos
2016-05-23 09:13:59 +01:00
Martin Kojtal bd78f98496 Merge pull request #1750 from NXPmicro/dev_ksdk_2.0
Fix for Issue#1740.
2016-05-22 16:47:45 +01:00
Krzysztof Sitko db8595264a STM32F031K6 Missing UART_RX Pin Def
PA3 on the STM32F031K6 can function as a USART1_RX pin.
2016-05-20 12:58:36 -04:00
Bartosz Szczepanski fad2190225 [NUCLEO_F042K6] Added CAN support
Added CAN API support for NUCLEO_F042K6 target.

"stm32f042x6.h" file was changed to avoid compilation errors.

Change-Id: I9622a233775fc6834201a322740bf5026244d50e
2016-05-20 13:27:58 +02:00
Bartosz Szczepanski d140e9959a [NUCLEO_F072RB] Added CAN support
Added CAN API support for NUCLEO_F072RB target.

*stm32f072xb.h* file was changed to avoid compilation errors.

Change-Id: I9da75fde29fd19f0326d554acc1dbb5386b08317
2016-05-20 11:48:34 +02:00
Bartosz Szczepanski 8577163ca3 [NUCLEO_F091RC] Added CAN support
Added CAN API suport for NUCLEO_F091RC target.

*stm32f091xc.h* file was changed to avoid compilation errors.

Change-Id: I9207575a0e2ad0f8e3a4bb78eb23d1e7b4a94171
2016-05-20 11:48:33 +02:00
Bartosz Szczepanski f04377d889 Added CAN API for STM32F0xx family
* STM32F0xx family have only one CAN bus

Change-Id: Id17fbfb825fabe04725a829a121300290f074919
2016-05-20 11:26:55 +02:00
Toyomasa Watarai 3281f5fb9a [LPC812] Fix PwmOut conflict issue
* Use conflict resolution register to set/clear output
2016-05-20 13:40:02 +09:00
tomoyuki yamanaka 829b422a6d Bug fix for IAR support.
We modified function definition for IAR support.
2016-05-18 16:10:30 +09:00
Bogdan Marinescu bc063a3903 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 workspace_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, check docs/mbed_targets.md
(also part of this PR) for a more complete description):

- "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.
I tested compilation for a number of targets (K64F, LPC1768, NRF51822)
but there's definitely a lot more to be done in terms of testing.

I also 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/c9d8cf34214109a4b9079befed6b3c0c

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

NRF51_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 Python
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 21:42:55 +03:00
Mahadevan Mahesh e6e1f73599 Fix for Issue#1740. The latest SDK drivers for FTM & TPM has the fix for this issue
This fixes issues seen when running FTM and TPM demos in certain modes

Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2016-05-17 12:03:14 -05:00
bcostm 315d143382 Change macro names for FORCE/RELEASE_RESET for UART4, 5, 6, 7 2016-05-17 16:46:31 +02:00
Martin Kojtal a1914e17f3 Merge pull request #1742 from ohagendorf/STM32F4xx_PR1707_bugfix
[STM32F4xx] bugfix for PR #1707
2016-05-17 14:42:31 +01:00
Martin Kojtal b77f84df32 Merge pull request #1747 from TomoYamanaka/master_branch
Fixed a problem that can not be the task generation in Cortex-A9.
2016-05-17 12:56:08 +01:00
TomoYamanaka 909c76f36c In IAR compile, change the sequence of the ROM section. (#1722)
we changed the sequence of ROM section to "<ro code> <ro data>" when compiled with the IAR.

When the ROM area is large, PC could not jump properly in the program area.
The other development environment of this sequence ("ro code, ro data").
2016-05-17 12:39:47 +01:00
tomoyuki yamanaka bebc235ffb Bug fix of Serial in IAR compile
We fixed bug of Serial in IAR complie.
We modified so as to have #if defined ( __ICCARM__ )  definition as well.
2016-05-17 20:35:49 +09:00
tomoyuki yamanaka d0250bb09e Fixed a problem that can not be the task generation in Cortex-A9.
https://github.com/mbedmicro/mbed/pull/1702
    In this PR, rtx has updated, the macro into the code were changed.
    However, by this macro, the process of task generation in Cortex-A9 can no longer be run.
    So, we solve the task generation problem by changing the macro into Tread.cpp again.
2016-05-17 20:18:10 +09:00