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

Add new target NUMAKER_PFM_NANO130 #4631

Merged
merged 36 commits into from Aug 14, 2017

Conversation

Projects
None yet
7 participants
@cyliangtw
Contributor

cyliangtw commented Jun 26, 2017

Description

This PR is to add support for Nuvoton's new target NUMAKER_PFM_NANO130.

Greentea Test

All pass: attached the test log files of mbed Greentea test at ARMCC, GCC, IAR & uARM toolchain,
os55_greentea_GCC.txt
os55_greentea_IAR.txt
os55_greentea_uARM.txt
os55_greentea_ARM.txt

The snippet of GCC test log as below:

+-----------------------------+---------------------+--------------------------------------------------------------------------------------+--------+--------------------+-------------+
| target                      | platform_name       | test suite                                                                           | result | elapsed_time (sec) | copy_method |
+-----------------------------+---------------------+--------------------------------------------------------------------------------------+--------+--------------------+-------------+
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-features-frameworks-utest-tests-unit_tests-basic_test                        | OK     | 14.9               | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-features-frameworks-utest-tests-unit_tests-basic_test_default                | OK     | 14.9               | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-features-frameworks-utest-tests-unit_tests-case_async_validate               | OK     | 16.63              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-features-frameworks-utest-tests-unit_tests-case_control_async                | OK     | 22.48              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-features-frameworks-utest-tests-unit_tests-case_control_repeat               | OK     | 19.49              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-features-frameworks-utest-tests-unit_tests-case_selection                    | OK     | 14.88              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-features-frameworks-utest-tests-unit_tests-case_setup_failure                | OK     | 15.62              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-features-frameworks-utest-tests-unit_tests-case_teardown_failure             | OK     | 15.42              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-features-frameworks-utest-tests-unit_tests-control_type                      | OK     | 18.15              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-features-frameworks-utest-tests-unit_tests-minimal_async_scheduler           | OK     | 15.72              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-features-frameworks-utest-tests-unit_tests-minimal_scheduler                 | OK     | 16.41              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-features-frameworks-utest-tests-unit_tests-test_assertion_failure_test_setup | OK     | 14.56              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-features-frameworks-utest-tests-unit_tests-test_setup_case_selection_failure | OK     | 14.72              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-features-frameworks-utest-tests-unit_tests-test_setup_failure                | OK     | 14.73              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-features-tests-filesystem-heap_block_device                                  | OK     | 16.78              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-features-tests-filesystem-mbr_block_device                                   | OK     | 17.95              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-features-tests-filesystem-util_block_device                                  | OK     | 15.17              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-rtos-rtx5-target_cortex_m-tests-memory-heap_and_stack                        | OK     | 14.28              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-events-queue                                                           | OK     | 21.97              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-events-timing                                                          | OK     | 76.01              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-integration-basic                                                      | OK     | 13.94              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbed_drivers-c_strings                                                 | OK     | 16.68              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbed_drivers-dev_null                                                  | OK     | 16.78              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbed_drivers-echo                                                      | OK     | 28.17              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbed_drivers-generic_tests                                             | OK     | 15.37              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbed_drivers-lp_timeout                                                | OK     | 23.89              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbed_drivers-race_test                                                 | OK     | 19.23              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbed_drivers-rtc                                                       | OK     | 25.39              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbed_drivers-stl_features                                              | OK     | 15.47              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbed_drivers-ticker                                                    | OK     | 48.08              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbed_drivers-timeout                                                   | OK     | 25.56              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbed_drivers-wait_us                                                   | OK     | 25.48              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbed_functional-callback                                               | OK     | 16.31              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbed_functional-callback_big                                           | OK     | 16.28              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbed_functional-callback_small                                         | OK     | 16.25              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbed_functional-functionpointer                                        | OK     | 14.95              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbed_hal-lp_ticker                                                     | OK     | 23.47              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbed_hal-rtc_time                                                      | OK     | 140.24             | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbed_hal-ticker                                                        | OK     | 23.72              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbedmicro-mbed-attributes                                              | OK     | 16.6               | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbedmicro-mbed-call_before_main                                        | OK     | 14.21              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbedmicro-mbed-cpp                                                     | OK     | 14.33              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbedmicro-mbed-div                                                     | OK     | 14.4               | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbedmicro-mbed-static_assert                                           | OK     | 14.57              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbedmicro-rtos-mbed-basic                                              | OK     | 25.41              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbedmicro-rtos-mbed-isr                                                | OK     | 19.39              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbedmicro-rtos-mbed-mail                                               | OK     | 15.88              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbedmicro-rtos-mbed-malloc                                             | OK     | 29.18              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbedmicro-rtos-mbed-mutex                                              | OK     | 27.13              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbedmicro-rtos-mbed-queue                                              | OK     | 18.92              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbedmicro-rtos-mbed-semaphore                                          | OK     | 21.8               | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbedmicro-rtos-mbed-signals                                            | OK     | 19.39              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbedmicro-rtos-mbed-threads                                            | OK     | 20.3               | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbedmicro-rtos-mbed-timer                                              | OK     | 25.0               | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-mbedtls-selftest                                                       | OK     | 30.71              | shell       |
| NUMAKER_PFM_NANO130-GCC_ARM | NUMAKER_PFM_NANO130 | mbed-os-tests-netsocket-ip_parsing                                                   | OK     | 19.86              | shell       |
+-----------------------------+---------------------+--------------------------------------------------------------------------------------+--------+--------------------+-------------+
mbedgt: test suite results: 56 OK

ccchang12 and others added some commits Apr 13, 2017

[NANO130] Align with mbed master
1. Remove RTX_CM_lib.h modification for NANO130 platform
2. Remove semaphore test code's speific modification for NANO130 platform
3. Fix duplicate definitions of __NVIC_SetVector/__NVIC_GetVector
4. Add spi_master_block_write()
[NANO130] Fix issues in OS 5.5 Greentea test
1. Support CMSIS_VECTAB_VIRTUAL feature
2. Reduce the register sync waiting time in LP ticker
3. Adjust the stack and heap size in GCC and IAR toolchains
@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Jun 26, 2017

@cyliangtw Could you remove the [ and ] from the PR title? we use the PR titles in the release notes, which are formatted with markdown, and the brackets are markdown syntax.

@cyliangtw cyliangtw changed the title from [NANO130] Add new target NUMAKER_PFM_NANO130 to Add new target NUMAKER_PFM_NANO130 Jun 27, 2017

@cyliangtw

This comment has been minimized.

Contributor

cyliangtw commented Jun 27, 2017

@theotherjimmy, yes, I removed [ and ] from the title to avoid markdown reserved syntax.

@@ -162,6 +162,10 @@ def compile(self, cc, source, object, includes):

cmd.extend(self.get_dep_option(object))

# Remove '.\' from relative path names of source files. For example, '.\mbed-os\platform\retarget.cpp' will truncate to 'mbed-os\platform\retarget.cpp'.

This comment has been minimized.

@0xc0170

0xc0170 Jul 4, 2017

Member

I believe this shall be sent as separate patch

This comment has been minimized.

@cyliangtw

cyliangtw Jul 5, 2017

Contributor

Fixed in commit 127a09c

"is_disk_virtual": true,
"supported_toolchains": ["ARM", "uARM", "GCC_ARM", "IAR"],
"inherits": ["Target"],
"progen": {"target": "numaker-pfm-nano130"},

This comment has been minimized.

@0xc0170

0xc0170 Jul 4, 2017

Member

this line (2922) can be removed, not used anymore

This comment has been minimized.

@cyliangtw

cyliangtw Jul 5, 2017

Contributor

Fixed in commit 348fa75

@@ -19,7 +19,7 @@

#include <stdint.h>

#if defined(TARGET_NUMAKER_PFM_NUC472)
#if defined(TARGET_NUVOTON)

This comment has been minimized.

@0xc0170

0xc0170 Jul 4, 2017

Member

I have seen this change in another PR to add another nuvoton target - I dont see any dependency, so this one might state it and will be rebased ?

This comment has been minimized.

@cyliangtw

cyliangtw Jul 5, 2017

Contributor

In both of these 2 PR NANO130 & M487, they have the same mbed_rtx.h .

#define TMR_CMP_MIN 2
#define TMR_CMP_MAX 0xFFFFFFu

void us_ticker_init(void)

This comment has been minimized.

@0xc0170

0xc0170 Jul 4, 2017

Member

I can see lot of copy paste in nuvoton targets. I was reviewing tickers the last week, are they using the same peripheral with only slight changes? Is there a chance all these would be unified?

This comment has been minimized.

@cyliangtw

cyliangtw Jul 5, 2017

Contributor

Yes, we have the plan to review the unchanged part of chip series of our existing platforms and future platforms, then the unified code will be possible.

PDMA_SAR_INC, // Source address incremental
(uint32_t) NU_MODBASE(obj->serial.uart), // Destination address
PDMA_DAR_FIX); // Destination address fixed
#if 0 // NOTE:

This comment has been minimized.

@0xc0170

0xc0170 Jul 4, 2017

Member

dead code ,pleas remove

This comment has been minimized.

@cyliangtw

cyliangtw Jul 5, 2017

Contributor

Fixed in commit 2f8e3fb


#include "cmsis.h"

// NOTE: Ensurce mbed_sdk_init() will get called before C++ global object constructor.

This comment has been minimized.

@0xc0170

0xc0170 Jul 4, 2017

Member

is this needed? I believe not

This comment has been minimized.

@cyliangtw

cyliangtw Jul 5, 2017

Contributor

Yes, it's needed. The cmsis.h will include target specific header files for mbed_overrides.c .

This comment has been minimized.

@0xc0170

0xc0170 Jul 11, 2017

Member

I was referring to the line below, 19 lines and below, regarding C++ global object constructors. I would say these lines can be removed?

This comment has been minimized.

@ccchang12

ccchang12 Jul 11, 2017

Contributor

Remove the unused code of mbed_sdk_init_forced() in commit 3bbacad.


uint32_t pin_index = NU_PINNAME_TO_PIN(pin);

#if 1

This comment has been minimized.

@0xc0170

0xc0170 Jul 4, 2017

Member

dead code pls remove from any file here

This comment has been minimized.

@cyliangtw

cyliangtw Jul 5, 2017

Contributor

Fixed in commit 2f8e3fb

void (*vec)(void);
};

// NOTE: NANO130 doesn't support relocating vector table. ISR vector passed into NVIC_SetVector() can only be weak symbol defined in startup_Nano100Series.c.

This comment has been minimized.

@0xc0170

0xc0170 Jul 4, 2017

Member

how does this work? no VTOR, thus how is it working ?

This comment has been minimized.

@cyliangtw

cyliangtw Jul 5, 2017

Contributor

Though not support VTOR at M0, for keep the same architecture, we implemented vec to point to the same original embedded flash.
@ccchang12

return (elapsed >= timeout);
}

#if 0

This comment has been minimized.

@0xc0170

0xc0170 Jul 4, 2017

Member

to be removed

This comment has been minimized.

@cyliangtw

cyliangtw Jul 5, 2017

Contributor

Fixed in commit 2f8e3fb

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Aug 7, 2017

/morph-test

@mbed-bot

This comment has been minimized.

mbed-bot commented Aug 7, 2017

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph export-build

Output

mbed Build Number: 112

Exporter Build failed!

@ccchang12

This comment has been minimized.

Contributor

ccchang12 commented Aug 9, 2017

@0xc0170 , It shows the result of "/morph export-build" is failure yesterday, but the link of job/exporter_build_test/112/ cannot be found. How can I check the output message to fix the issue?

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Aug 9, 2017

/morph test

@mbed-bot

This comment has been minimized.

mbed-bot commented Aug 9, 2017

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 970

Build failed!

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Aug 9, 2017

This one from the last run : build_matrix » NUMAKER_PFM_NANO130,IAR completed with result FAILURE

The previous export build was due to master issue that was fixed yesterday, we will rerun once the above failure is fixed, please review

@0xc0170 0xc0170 added needs: work and removed needs: CI labels Aug 9, 2017

@ccchang12

This comment has been minimized.

Contributor

ccchang12 commented Aug 10, 2017

@0xc0170 , modify the .icf file of IAR toolchain to fix the build error. In original code, the total uncommitted space is 0x3800. But in FAIL result log, the TESTS-MBED_DRIVERS-C_STRINGS allocates space for sections/blocks with size of 0x3810 bytes. Now enlarge the total uncommitted space to be 0x3a00 to fix the issue.

But how we can duplicate this issue? After merge with master, the allocates space of TESTS-MBED_DRIVERS-C_STRINGS is only 0x3640 bytes, not 0x3810 bytes. So we cannot duplicate this issue in our environment. From the log file, I saw the "morph test" includes "-DMBED_TRAP_ERRORS_ENABLED=1", "-DMBED_STACK_STATS_ENABLED=1" and "-DMBED_HEAP_STATS_ENABLED=1" options. Is it the root cause? If yes, how we can enable these options?

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Aug 11, 2017

But how we can duplicate this issue? After merge with master, the allocates space of TESTS-MBED_DRIVERS-C_STRINGS is only 0x3640 bytes, not 0x3810 bytes. So we cannot duplicate this issue in our environment. From the log file, I saw the "morph test" includes "-DMBED_TRAP_ERRORS_ENABLED=1", "-DMBED_STACK_STATS_ENABLED=1" and "-DMBED_HEAP_STATS_ENABLED=1" options. Is it the root cause? If yes, how we can enable these options?

Compile with this defines, and run greentea to point to the binary file (2 step process). You should be able to reproduce it.

These 2 commands you can edit to get the output you need:

mbed test --compile -m K64F -t ARM -n tests-mbed_hal-lp_ticker -DMBED_MEM_TRACING_ENABLED=1 -DMBED_HEAP_STATS_ENABLED=1

mbedgt -n tests-mbed_hal-lp_ticker -v -V
@ccchang12

This comment has been minimized.

Contributor

ccchang12 commented Aug 14, 2017

@0xc0170 , The build error issue had been fixed in commit 346209e, please help to remove work and add CI label.

@0xc0170 0xc0170 added needs: CI and removed needs: work labels Aug 14, 2017

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Aug 14, 2017

/morph test

@mbed-bot

This comment has been minimized.

mbed-bot commented Aug 14, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1031

All builds and test passed!

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Aug 14, 2017

/morph export-build

@mbed-bot

This comment has been minimized.

mbed-bot commented Aug 14, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph export-build

Output

mbed Build Number: 125

All exports and builds passed!

@theotherjimmy theotherjimmy merged commit 0977206 into ARMmbed:master Aug 14, 2017

5 checks passed

Cam-CI uvisor Build & Test Success
Details
ci/morph-export-build Job has completed
Details
ci/morph-test Job has completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@adbridge

This comment has been minimized.

Contributor

adbridge commented Aug 25, 2017

@cyliangtw This commit: bc0fc2e
is a merge commit and contains changes to 3000 files! In the future please do not submit merge commits as this affects our ability to backport the changes to the next patch release.
It is also good practice not to submit PRs with large numbers of individual commits. In the future please use rebase and squash.
@theotherjimmy before merging can we please quickly check each individual commit on a PR to ensure we don't get this kind of issue.

@cyliangtw

This comment has been minimized.

Contributor

cyliangtw commented Aug 28, 2017

@adbridge , thanks of your advice, we will follow your rule to avid too many individual commits & do rebase before send one PR.

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Aug 28, 2017

@cyliangtw We actually encourage having many commits, so long as they are a logical section of work. @adbridge was trying to tell you not to do merge commits in PRs (created by git merge and the default behavior of git pull). We encourage using git rebase to correct conflicts and make you PR up to date.

@cyliangtw

This comment has been minimized.

Contributor

cyliangtw commented Aug 29, 2017

@theotherjimmy Thanks of your explanation, our original purpose of git merge instead of rebase is for easier tracking our target's history. Anyway, the side effect will impact master branch, so go back rebase is the better way and we will follow it in next PR.

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