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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions targets/targets.json
Expand Up @@ -2052,6 +2052,7 @@
"LPC"
],
"detect_code": ["0236"],
"device_name": "LPC55S69JBD100",
"release_versions": ["5"]
},
"LPC55S69_NS": {
Expand Down
104 changes: 104 additions & 0 deletions tools/arm_pack_manager/index.json
Expand Up @@ -157016,6 +157016,110 @@
],
"vendor": "NXP:11"
},
"LPC55S69JBD100": {
"algorithms": [
{
"default": false,
"file_name": "arm/LPC55XX_640.FLM",
"ram_size": 4096,
"ram_start": 536870912,
"size": 622592,
"start": 0
}
],
"from_pack": {
"pack": "LPC55S69_DFP",
"url": "http://mcuxpresso.nxp.com/cmsis_pack/repo/",
"vendor": "NXP",
"version": "11.0.0"
},
"memories": {
"PROGRAM_FLASH": {
"access": {
"execute": true,
"non_secure": false,
"non_secure_callable": false,
"peripheral": false,
"read": true,
"secure": false,
"write": false
},
"default": true,
"size": 622592,
"start": 0,
"startup": true
},
"SRAMX": {
"access": {
"execute": false,
"non_secure": false,
"non_secure_callable": false,
"peripheral": false,
"read": true,
"secure": false,
"write": true
},
"default": false,
"size": 32768,
"start": 67108864,
"startup": false
},
"SRAM": {
"access": {
"execute": false,
"non_secure": false,
"non_secure_callable": false,
"peripheral": false,
"read": true,
"secure": false,
"write": true
},
"default": true,
"size": 278528,
"start": 536870912,
"startup": false
},
"USB_RAM": {
"access": {
"execute": false,
"non_secure": false,
"non_secure_callable": false,
"peripheral": false,
"read": true,
"secure": false,
"write": true
},
"default": false,
"size": 16384,
"start": 1074790400,
"startup": false
}
},
"name": "LPC55S69JBD100",
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

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

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.

"processor": {
"Asymmetric": {
"cm33_core0": {
"core": "CortexM33",
"fpu": "SinglePrecision",
"mpu": "Present",
"units": 1
},
"cm33_core1": {
"core": "CortexM33",
"fpu": "None",
"mpu": "NotPresent",
"units": 1
}
}
},
"sectors": [
[
0,
32768
]
],
"vendor": "NXP:11"
},
"LPC802M001JDH16": {
"algorithms": [
{
Expand Down
8 changes: 6 additions & 2 deletions tools/export/cmsis/__init__.py
Expand Up @@ -51,10 +51,14 @@ def __init__(self, target):
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']
)
Expand Down
3 changes: 3 additions & 0 deletions tools/export/iar/iar_definitions.json
Expand Up @@ -96,6 +96,9 @@
"LPC54628J512ET180": {
"OGChipSelectEditMenu": "LPC54618J512\tNXP LPC54618J512"
},
"LPC55S69JBD100": {
"OGChipSelectEditMenu": "LPC55S69_core0\tNXP LPC55S69_core0"
},
"STM32F072RB": {
"OGChipSelectEditMenu": "STM32F072RB\tST STM32F072RB"
},
Expand Down
3 changes: 2 additions & 1 deletion tools/export/uvision/__init__.py
Expand Up @@ -137,7 +137,8 @@ class Uvision(Exporter):
"LPC4088Code.binary_hook",
"MTSCode.combine_bins_mts_dot",
"MTSCode.combine_bins_mts_dragonfly",
"NCS36510TargetCode.ncs36510_addfib"
"NCS36510TargetCode.ncs36510_addfib",
"LPC55S69Code.binary_hook"
])

# File associations within .uvprojx file
Expand Down