Skip to content

Nuvoton: Support export IAR8 project #10282

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

Merged
merged 1 commit into from
Apr 4, 2019

Conversation

ccli8
Copy link
Contributor

@ccli8 ccli8 commented Apr 1, 2019

Description

This PR adds support for export IAR8 project on Nuvoton targets:

  • NUMAKER_PFM_NANO130
  • NUMAKER_PFM_NUC472
  • NUMAKER_PFM_M453
  • NUMAKER_PFM_M487/NUMAKER_IOT_M487

With IAR project successfully exported, to successfully develop and debug on Nuvoton targets, it needs extra steps. See doc here.

Pull request type

[X] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

@ciarmcom ciarmcom requested review from a team April 1, 2019 11:00
@ciarmcom
Copy link
Member

ciarmcom commented Apr 1, 2019

@ccli8, thank you for your changes.
@ARMmbed/mbed-os-tools @ARMmbed/mbed-os-maintainers please review.

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 1, 2019

With IAR project successfully exported, to successfully develop and debug on Nuvoton targets, it needs extra steps. See doc here.

Will this be doc anywhere else , at least referenced ? I read the doc, don't understand the last section - "Check configurations in IAR EWARM IDE" - if I do export now, would I need to do any of these steps or would it work out of the box?

Copy link
Contributor

@bridadan bridadan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're changes look fine to me, but I also have the same questions as @0xc0170. If these are manual changes, perhaps these could be integrated into the exporter template so users don't have to make these changes.

@cmonr
Copy link
Contributor

cmonr commented Apr 1, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Apr 2, 2019

Test run: SUCCESS

Summary: 13 of 13 test jobs passed
Build number : 1
Build artifacts

@cmonr
Copy link
Contributor

cmonr commented Apr 2, 2019

This looks ready to be brought in, but @ccli8 would you mind answering the reviewers' thoughts/concerns before we do?

1. Override IlinkOverrideProgramEntryLabel and IlinkProgramEntryLabel to specify
   entry point for debuger.
2. Refer to doc at the link below for post-export steps. Usually, 'export' is nearly
   out of the box and just install 'Nu-Link Driver (IAR)' to update Nuvoton device
   database in IAR.
   https://github.com/OpenNuvoton/NuMaker-mbed-docs/blob/master/IAR/DEBUG_IAR.md
@ccli8 ccli8 force-pushed the nuvoton_export-iar8 branch from 816dd4d to 50f6870 Compare April 2, 2019 02:41
@ccli8
Copy link
Contributor Author

ccli8 commented Apr 2, 2019

@0xc0170 @bridadan Update to make the exported IAR project out of the box. Now, the only extra step is to install Nu-Link Driver (IAR). The Debug IAR doc is also updated to reflect the change. I will ask addition of its link in board pages.

@cmonr cmonr requested review from bridadan and 0xc0170 April 2, 2019 02:59
@cmonr
Copy link
Contributor

cmonr commented Apr 2, 2019

CI restarted whilst waiting on re-reviews since CI load is light atm.

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 2, 2019

@ccli8 Why do these target need different entry point ? All targets should use the same boot sequence.
It should be __iar_program_start , defined in mbed_boot_iar.c

Changes looks fine, not certain if this is needed - do we need to change the default boot sequence - why?

Checking one of the targets here. There are couple of reset handlers (3), and iar_program_start is called in Reset_Handler_2. Do we miss anything in the boot sequence?

@ccli8
Copy link
Contributor Author

ccli8 commented Apr 2, 2019

@0xc0170 Most targets reboots from Reset_Handler, calls SystemInit and then __iar_program_start. Nuvoton targets also follow this boot sequence. In debugger, PC will directly set to entry point on reset (per my test). If entry point is set to __iar_program_start, Reset_Handler code is not run. This will cause problem for e.g. NUMAKER_PFM_M487 target, in which some extra RAM initializatioin is done in SystemInit.

Copy link
Contributor

@bridadan bridadan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tools changes look fine, thanks! (Though the conversation that @0xc0170 should probably be addressed before merging this)

@cmonr
Copy link
Contributor

cmonr commented Apr 2, 2019

@ARMmbed/mbed-os-core
@ccli8 made some good observations about IAR8's debugger reset behavior. Should this change be looked at for all exports?

Oh, and I don't think that this target-specific change be blocked on said question since this change appears to be properly target-specific.

@mbed-ci
Copy link

mbed-ci commented Apr 2, 2019

Test run: SUCCESS

Summary: 13 of 13 test jobs passed
Build number : 2
Build artifacts

@0xc0170 0xc0170 merged commit 8b5157b into ARMmbed:master Apr 4, 2019
@0xc0170
Copy link
Contributor

0xc0170 commented Apr 4, 2019

We should look at this if we should not make the change to have this by default set to Reset_Handler (not iar program start function).

@ccli8 ccli8 deleted the nuvoton_export-iar8 branch April 8, 2019 01:19
@0xc0170
Copy link
Contributor

0xc0170 commented Apr 9, 2019

@ccli8 Is there anything needed for this PR? I run nightly on 5.12.1 and some of these targets fail IAR8 exporter with the error: examples\mbed-os-example-blinky\mbed-os\cmsis\TARGET_CORTEX_M\cmsis_iccarm.h(94) : Fatal Error[Pe035]: #error directive: "Unknown target." Error while running C/C++ Compiler or similar.

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 9, 2019

You should be able to reproduce using blinky: Exporting mbed-os-example-blinky NUMAKER_PFM_NANO130 iar - it fails

@ccli8
Copy link
Contributor Author

ccli8 commented Apr 9, 2019

It seems that Nu-Link_IAR_Driver is not installed in your test environment.

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 9, 2019

@ARMmbed/mbed-os-test ^^

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 9, 2019

Created internal ticket MBEDOSTEST-589

@OPpuolitaival
Copy link
Contributor

@timurh01 can you install missing package?

@timurh01
Copy link
Contributor

timurh01 commented Apr 9, 2019

@0xc0170 @OPpuolitaival IAR driver is now installed

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

Successfully merging this pull request may close these issues.

8 participants