Skip to content

LPC55S69: Add IAR and uvision exporter support #10068

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 2 commits into from
Mar 15, 2019

Conversation

mmahadevan108
Copy link
Contributor

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
Copy link
Contributor Author

Depends on #9994

@mikisch81
Copy link
Contributor

@Alonof @mottigondabi FYI

@mikisch81
Copy link
Contributor

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

@ciarmcom
Copy link
Member

@mmahadevan108, thank you for your changes.
@mikisch81 @maclobdell @theotherjimmy @orenc17 @ARMmbed/mbed-os-tools @ARMmbed/mbed-os-maintainers please review.

@mikisch81
Copy link
Contributor

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

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.

Changes look fine to me!

Copy link
Contributor

@theotherjimmy theotherjimmy left a comment

Choose a reason for hiding this comment

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

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
Copy link
Contributor

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

@0xc0170 0xc0170 requested a review from a user March 13, 2019 09:45
@0xc0170
Copy link
Contributor

0xc0170 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
Copy link
Contributor Author

@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",
Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

@mmahadevan108 mmahadevan108 Mar 13, 2019

Choose a reason for hiding this comment

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

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

Copy link
Contributor

@theotherjimmy theotherjimmy Mar 13, 2019

Choose a reason for hiding this comment

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

👍 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']
         )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Contributor

Choose a reason for hiding this comment

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

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

@mmahadevan108
Copy link
Contributor Author

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

@theotherjimmy
Copy link
Contributor

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

@theotherjimmy
Copy link
Contributor

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

@mmahadevan108
Copy link
Contributor Author

You have to apply the patch from #9994

@mmahadevan108
Copy link
Contributor Author

mbed export -i uvision6 -m LPC55S69_NS

@theotherjimmy
Copy link
Contributor

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

@theotherjimmy
Copy link
Contributor

Got it working, Had to rebase onto master again.

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 14, 2019

CI started

@mbed-ci
Copy link

mbed-ci 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

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 14, 2019

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

Once we fix this, test will be restarted

@mmahadevan108 mmahadevan108 force-pushed the Add_LPC55S96_Exporter_Support branch from f733205 to 3da7c6f Compare March 14, 2019 12:25
@0xc0170
Copy link
Contributor

0xc0170 commented Mar 14, 2019

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

@mmahadevan108
Copy link
Contributor Author

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

@mmahadevan108
Copy link
Contributor Author

@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
Copy link
Contributor Author

@0xc0170 . This PR is ready

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 14, 2019

CI started

@theotherjimmy
Copy link
Contributor

theotherjimmy 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 😱)

Copy link
Contributor

@theotherjimmy theotherjimmy left a comment

Choose a reason for hiding this comment

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

We're good to go now.

@mmahadevan108
Copy link
Contributor Author

mmahadevan108 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
Copy link
Contributor Author

@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
Copy link

mbed-ci 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
Copy link
Contributor Author

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
Copy link
Contributor

0xc0170 commented Mar 14, 2019

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

@NirSonnenschein
Copy link
Contributor

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
Copy link
Contributor

cmonr commented Mar 14, 2019

armclang: error: Failed to check out a license.

Exporter job restarted.

@cmonr
Copy link
Contributor

cmonr commented Mar 15, 2019

CI failures still seem incredibly suspicious.

Restarting CI completely.

@mbed-ci
Copy link

mbed-ci 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
Copy link
Contributor

0xc0170 commented Mar 15, 2019

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

@0xc0170 0xc0170 merged commit cde7d0b into ARMmbed:master Mar 15, 2019
@mmahadevan108 mmahadevan108 deleted the Add_LPC55S96_Exporter_Support branch March 15, 2019 18:19
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.

9 participants