Skip to content
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

LPC55S69: Add IAR and uvision exporter support #10068

Merged
merged 2 commits into from Mar 15, 2019

Conversation

Projects
None yet
9 participants
@mmahadevan108
Copy link
Contributor

commented Mar 12, 2019

Description

Add IAR and uvision exporter support for LPC55S69

Pull request type

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

Reviewers

@orenc17 @theotherjimmy @mikisch81 @maclobdell

@mmahadevan108

This comment has been minimized.

Copy link
Contributor Author

commented Mar 12, 2019

Depends on #9994

@mikisch81

This comment has been minimized.

Copy link
Contributor

commented Mar 12, 2019

@mikisch81

This comment has been minimized.

Copy link
Contributor

commented Mar 12, 2019

@ARMmbed/mbed-os-maintainers can it be rc3? It will significantly help debugging Pelion client integration.

@ciarmcom ciarmcom requested review from maclobdell, mikisch81, orenc17, theotherjimmy and ARMmbed/mbed-os-maintainers Mar 12, 2019

@ciarmcom

This comment has been minimized.

Copy link
Member

commented Mar 12, 2019

@mikisch81

This comment has been minimized.

Copy link
Contributor

commented Mar 12, 2019

I tried it on my Windows machine and got this when trying to build the target:

*** Using Compiler 'V6.10.1', folder: 'C:\Keil_v5\ARM\ARMCompiler6.10.1\Bin'
Build target 'mbed_app'
compiling ac_buffer.c...
armclang.exe: error: no such file or directory: 'target'
armclang.exe: error: no such file or directory: 'not'
armclang.exe: error: no such file or directory: 'found'

Ran mbed export -i uvision6 -m LPC55S69_NS --profile debug

@bridadan
Copy link
Contributor

left a comment

Changes look fine to me!

@theotherjimmy
Copy link
Contributor

left a comment

Changes look good. Sorry that my last CPM sync missed that device pack download. Could you comment on how uvision re-implements the same post-build script?

@theotherjimmy

This comment has been minimized.

Copy link
Contributor

commented Mar 12, 2019

@mikisch81 You're missing the Device Family Pack. It should have prompted for install when you opened the project.

@0xc0170

This comment has been minimized.

Copy link
Member

commented Mar 13, 2019

@ARMmbed/mbed-os-maintainers can it be rc3? It will significantly help debugging Pelion client integration.

5.12.0-rc3 label added, waiting for approvals

@mmahadevan108

This comment has been minimized.

Copy link
Contributor Author

commented Mar 13, 2019

@theotherjimmy . The Target section is not set correctly in the project generated by exporter.
Target_Incorrect

When I switch to a different device and come back to LPC55S69, then the target section gets updated with the right value:
Target_Correct

Can you take a look at the exporter code.

"startup": false
}
},
"name": "LPC55S69JBD100:cm33_core0",

This comment has been minimized.

Copy link
@theotherjimmy

theotherjimmy Mar 13, 2019

Contributor

This was not generated by CPM. please use the definition from CPM

This comment has been minimized.

Copy link
@mmahadevan108

mmahadevan108 Mar 13, 2019

Author Contributor

If do not use this name then the device selection is not made. When I set the name to this value, then it make the right device selection.
Device

This comment has been minimized.

Copy link
@theotherjimmy

theotherjimmy Mar 13, 2019

Contributor

We can do this another way without manually editing the index. I'll have comments on how soon.

This comment has been minimized.

Copy link
@theotherjimmy

theotherjimmy Mar 13, 2019

Contributor

I recommend:

diff --git a/tools/arm_pack_manager/index.json b/tools/arm_pack_manager/index.json
index 04099199fc..0e444f5400 100644
--- a/tools/arm_pack_manager/index.json
+++ b/tools/arm_pack_manager/index.json
@@ -157095,7 +157095,7 @@
                 "startup": false
             }
         },
-        "name": "LPC55S69JBD100:cm33_core0",
+        "name": "LPC55S69JBD100",
         "processor": {
             "Asymmetric": {
                 "cm33_core0": {
@@ -462779,4 +462779,4 @@
         "vendor": "Nordic Semiconductor:54"
     },
     "version": "0.2.0"
-}
\ No newline at end of file
+}
diff --git a/tools/export/cmsis/__init__.py b/tools/export/cmsis/__init__.py
index f4e4d94a18..0248c4f72e 100644
--- a/tools/export/cmsis/__init__.py
+++ b/tools/export/cmsis/__init__.py
@@ -51,10 +51,12 @@ class DeviceCMSIS():
         try:
             self.dfpu = target_info['processor']['Symmetric']['fpu']
         except KeyError:
-            cmsis_core = self.core.replace("F", "").replace("-", "")
-            for proc in target_info['processor']['Asymmetric'].values():
+            cmsis_core = self.core.replace("F", "").replace("-", "").replace("E", "")
+            for core_name, proc in target_info['processor']['Asymmetric'].items():
                 if proc['core'] == cmsis_core:
                     self.dfpu = proc['fpu']
+                    self.dname = '{}:{}'.format(self.dname, core_name)
+                    break
         self.debug, self.dvendor = self.vendor_debug(
             target_info.get('vendor') or target_info['from_pack']['vendor']
         )

I verified that this procudes the same LPC55S69JBD100:cm33_core0 string in the project file.

This comment has been minimized.

Copy link
@mmahadevan108

mmahadevan108 Mar 13, 2019

Author Contributor

Great thank you, I will update the name. Please help check the other issue with memory section.

This comment has been minimized.

Copy link
@mmahadevan108

mmahadevan108 Mar 13, 2019

Author Contributor

This change does not seem to be working

-            self.dfpu = target_info['processor']['Asymmetric']['fpu']
+            cmsis_core = self.core.replace("F", "").replace("-", "").replace("E", "")
+            for core_name, proc in target_info['processor']['Asymmetric'].items():
+                if proc['core'] == cmsis_core:
+                    self.dfpu = proc['fpu']
+                    self.dname = '{}:{}'.format(self.dname, core_name)
+                    break
+                print(self.dname)

PS C:\mbed-os-example-blinky> mbed export -i uvision6 -m LPC55S69_NS
[mbed] Working path "C:\mbed-os-example-blinky" (program)
Scan: mbed-os-example-blinky
LPC55S69JBD100
LPC55S69JBD100

This comment has been minimized.

Copy link
@theotherjimmy

theotherjimmy Mar 13, 2019

Contributor

👍 Good catch, I was uisng the _S variant. New patch below:

diff --git a/tools/arm_pack_manager/index.json b/tools/arm_pack_manager/index.json
index 04099199fc..0e444f5400 100644
--- a/tools/arm_pack_manager/index.json
+++ b/tools/arm_pack_manager/index.json
@@ -157095,7 +157095,7 @@
                 "startup": false
             }
         },
-        "name": "LPC55S69JBD100:cm33_core0",
+        "name": "LPC55S69JBD100",
         "processor": {
             "Asymmetric": {
                 "cm33_core0": {
@@ -462779,4 +462779,4 @@
         "vendor": "Nordic Semiconductor:54"
     },
     "version": "0.2.0"
-}
\ No newline at end of file
+}
diff --git a/tools/export/cmsis/__init__.py b/tools/export/cmsis/__init__.py
index f4e4d94a18..a4569122b5 100644
--- a/tools/export/cmsis/__init__.py
+++ b/tools/export/cmsis/__init__.py
@@ -51,10 +51,14 @@ class DeviceCMSIS():
         try:
             self.dfpu = target_info['processor']['Symmetric']['fpu']
         except KeyError:
-            cmsis_core = self.core.replace("F", "").replace("-", "")
-            for proc in target_info['processor']['Asymmetric'].values():
+            # TODO: refactor this into a "base_core_for" function
+            cmsis_core = self.core.replace("F", "").replace("-", "").replace("E", "")
+            cmsis_core = cmsis_core.replace("NS", "")
+            for core_name, proc in target_info['processor']['Asymmetric'].items():
                 if proc['core'] == cmsis_core:
                     self.dfpu = proc['fpu']
+                    self.dname = '{}:{}'.format(self.dname, core_name)
+                    break
         self.debug, self.dvendor = self.vendor_debug(
             target_info.get('vendor') or target_info['from_pack']['vendor']
         )

This comment has been minimized.

Copy link
@mmahadevan108

mmahadevan108 Mar 13, 2019

Author Contributor

Thanks this works. The Device Tab of the Project Options is set correctly. The Target Tab of the Properties is not correct.

This comment has been minimized.

Copy link
@theotherjimmy

theotherjimmy Mar 13, 2019

Contributor

It's a start. I'll look into what it would take to set the Target Tab correctly.

@mmahadevan108

This comment has been minimized.

Copy link
Contributor Author

commented Mar 13, 2019

Can you please clarify how the memories section is picked from index.json and populated into the uvision.tmpl file?

@theotherjimmy

This comment has been minimized.

Copy link
Contributor

commented Mar 13, 2019

@mmahadevan108 I'd have to look into that. I don't know off the top of my head.

@theotherjimmy

This comment has been minimized.

Copy link
Contributor

commented Mar 13, 2019

@mmahadevan108 I can't get uvision6 to export locally for LPC55S69 (_S or _NS), how do you get an export?

@mmahadevan108

This comment has been minimized.

Copy link
Contributor Author

commented Mar 13, 2019

You have to apply the patch from #9994

@mmahadevan108

This comment has been minimized.

Copy link
Contributor Author

commented Mar 13, 2019

mbed export -i uvision6 -m LPC55S69_NS

@theotherjimmy

This comment has been minimized.

Copy link
Contributor

commented Mar 13, 2019

@mmahadevan108 I have rebased your branch on top of #9994, and I still can't get an export going.

@theotherjimmy

This comment has been minimized.

Copy link
Contributor

commented Mar 13, 2019

Got it working, Had to rebase onto master again.

@mbed-ci

This comment has been minimized.

Copy link

commented Mar 14, 2019

Test run: FAILED

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

Failed test jobs:

  • jenkins-ci/mbed-os-ci_exporter
LPC55S69: Add IAR and uvision exporter support
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
@0xc0170

This comment has been minimized.

Copy link
Member

commented Mar 14, 2019

License issue , @ARMmbed/mbed-os-test ^^

Once we fix this, test will be restarted

Update to provide the right device name in the Asymmetric case
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>

@mmahadevan108 mmahadevan108 force-pushed the NXPmicro:Add_LPC55S96_Exporter_Support branch from f733205 to 3da7c6f Mar 14, 2019

@0xc0170

This comment has been minimized.

Copy link
Member

commented Mar 14, 2019

@mmahadevan108 what's the latest push ? Will restart CI once confirmed this is ready

@mmahadevan108

This comment has been minimized.

Copy link
Contributor Author

commented Mar 14, 2019

It includes the below commit per suggestion from @theotherjimmy.
3da7c6f

@mmahadevan108

This comment has been minimized.

Copy link
Contributor Author

commented Mar 14, 2019

@mikisch81 For the build issue, please pick a different device and then re-select the LPC55S69. This operation populates the right memory values.
This is a temporary fix till the memory section is properly populated.

@mmahadevan108

This comment has been minimized.

Copy link
Contributor Author

commented Mar 14, 2019

@0xc0170 . This PR is ready

@0xc0170

This comment has been minimized.

Copy link
Member

commented Mar 14, 2019

CI started

@theotherjimmy

This comment has been minimized.

Copy link
Contributor

commented Mar 14, 2019

@mmahadevan108 Could you post the <OnChipMemories> tree from the project after the workaroud? On second thought, we should have an issue for this, and @bridadan or @aashishc1988 and I can look into the incorrect memory stuff (the current template hard codes those values 😱)

@theotherjimmy
Copy link
Contributor

left a comment

We're good to go now.

@mmahadevan108

This comment has been minimized.

Copy link
Contributor Author

commented Mar 14, 2019

@mmahadevan108 Could you post the <OnChipMemories> tree from the project after the workaroud? On second thought, we should have an issue for this, and @bridadan or @aashishc1988 and I can look into the incorrect memory stuff (the current template hard codes those values 😱)

Here is the difference. The original project file has the below for CPU.
<Cpu>CPUTYPE("Cortex-M33FE") </Cpu>
The working version has the below:

      <Cpu>IRAM(0x20000000,0x044000) IRAM2(0x04000000,0x8000) IROM(0x00000000,0x098000) XRAM(0x40100000,0x4000) CPUTYPE("Cortex-M33") FPU3(SFPU) DSP TZ CLOCK(12000000) ELITTLE</Cpu>
@mmahadevan108

This comment has been minimized.

Copy link
Contributor Author

commented Mar 14, 2019

@mmahadevan108 Could you post the <OnChipMemories> tree from the project after the workaroud? On second thought, we should have an issue for this, and @bridadan or @aashishc1988 and I can look into the incorrect memory stuff (the current template hard codes those values 😱)

#10103

@mbed-ci

This comment has been minimized.

Copy link

commented Mar 14, 2019

Test run: FAILED

Summary: 1 of 13 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_exporter
@mmahadevan108

This comment has been minimized.

Copy link
Contributor Author

commented Mar 14, 2019

Test run: FAILED

Summary: 1 of 13 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_exporter

No idea on the failure. Seems unrelated to this PR

@0xc0170

This comment has been minimized.

Copy link
Member

commented Mar 14, 2019

I reported this to @ARMmbed/mbed-os-test . Will restart exporters

@NirSonnenschein

This comment has been minimized.

Copy link
Contributor

commented Mar 14, 2019

unexplained error (possibly license issue)
16:44:23 16:44:23 [UBLOX_EVK_ODIN_W2:make_armc6] Error: hudson.AbortException: script returned exit code 1
restarting exporters

@cmonr

This comment has been minimized.

Copy link
Contributor

commented Mar 14, 2019

armclang: error: Failed to check out a license.

Exporter job restarted.

@cmonr

This comment has been minimized.

Copy link
Contributor

commented Mar 15, 2019

CI failures still seem incredibly suspicious.

Restarting CI completely.

@mbed-ci

This comment has been minimized.

Copy link

commented Mar 15, 2019

Test run: FAILED

Summary: 1 of 13 test jobs failed
Build number : 3
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_exporter
@0xc0170

This comment has been minimized.

Copy link
Member

commented Mar 15, 2019

I restarted exporters the very last time (license server issue)

@0xc0170 0xc0170 added ready for merge and removed needs: CI labels Mar 15, 2019

@0xc0170 0xc0170 merged commit cde7d0b into ARMmbed:master Mar 15, 2019

28 checks passed

continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/build-ARMC5 Success
Details
jenkins-ci/build-ARMC6 Success
Details
jenkins-ci/build-GCC_ARM Success
Details
jenkins-ci/build-IAR8 Success
Details
jenkins-ci/cloud-client-test Success
Details
jenkins-ci/dynamic-memory-usage RTOS ROM(+0 bytes) RAM(-52 bytes)
Details
jenkins-ci/exporter Success
Details
jenkins-ci/greentea-test Success
Details
jenkins-ci/mbed2-build-ARMC5 Success
Details
jenkins-ci/mbed2-build-ARMC6 Success
Details
jenkins-ci/mbed2-build-GCC_ARM Success
Details
jenkins-ci/mbed2-build-IAR8 Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Local astyle testing has passed
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/doxy-spellcheck Local doxy-spellcheck testing has passed
Details
travis-ci/events Passed, runtime is 9143 cycles (-522 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/include_check Local include_check testing has passed
Details
travis-ci/licence_check Local licence_check testing has passed
Details
travis-ci/littlefs Passed, code size is 8408B (+0.00%)
Details
travis-ci/psa-autogen Local psa-autogen testing has passed
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details
travis-ci/tools-py3.5 Local tools-py3.5 testing has passed
Details
travis-ci/tools-py3.6 Local tools-py3.6 testing has passed
Details
travis-ci/tools-py3.7 Local tools-py3.7 testing has passed
Details

@mmahadevan108 mmahadevan108 deleted the NXPmicro:Add_LPC55S96_Exporter_Support branch Mar 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.