-
Notifications
You must be signed in to change notification settings - Fork 3k
Dual flash and Hex file support on NCS36510 #4397
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
Conversation
targets/targets.json
Outdated
@@ -2801,6 +2801,7 @@ | |||
"value": "0xFFFFFFFF" | |||
} | |||
}, | |||
"OUTPUT_EXT": "bin", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be the default...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to switch support to hex file output, this needs to be changed to "OUTPUT_EXT": "hex". even if the post build script takes the bin and converts it to hex, you still need to make this setting so that the online compiler will know to download the hex to the target and not the bin. this setting does require changes to the post build script.
There was a problem hiding this 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.
@studavekar can you check the CI result and re-run if necessary. From the logs, it looks like the failures are unrelated to the code changes made in this PR. |
targets/targets.json
Outdated
@@ -2846,4 +2847,4 @@ | |||
"inherits": ["SARA_NBIOT"], | |||
"extra_labels": ["ublox", "HI2110", "SARA_NBIOT"] | |||
} | |||
} | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this unrelated change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not done this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh. Well then. I'll reapprove this PR.
We use the pull request titles in the release notes, which are a markdown document. Could you change the title to avoid use of |
@theotherjimmy Done |
Thanks! |
I checked the build logs and there is no clear failure indicated. I suspect the build test needs to run again. |
@pradeep-gr It seems that your editor strips newlines. Can you change the setting and reinstate the newlines? This will cause warning and linting to fail |
@sg- Done. Can you try now? |
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputBuild failed! |
@pradeep-gr The Ci failed to build some of the tests for this platform, you can find build log here http://mbedosci.cloudapp.net/results/pr/4397/631 |
/morph test |
@@ -211,5 +238,4 @@ def add_fib_at_start(arginput): | |||
output_hex_file.merge(input_hex_file, overlap='error') | |||
|
|||
# Write out file(s) | |||
output_hex_file.tofile(file_name_hex, 'hex') | |||
output_hex_file.tofile(file_name_bin, 'bin') | |||
output_hex_file.tofile(file_name_hex, 'hex') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pradeep-gr
There is a merge error here that is causing everything to fail. Nothing builds until making a change here. Please add 4 spaces in front of this line to align it with the rest of the function.
output_hex_file.tofile(file_name_hex, 'hex')
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputBuild failed! |
@maclobdell @sg- @danclement @danish-iftikhar I am able to build successfully @ commit 9b082ff for GCC_ARM and ARM. But build not started for IAR. |
What does ti mean "not started" ? |
@0xc0170 |
@pradeep-gr The behavior when using IAR compiler sounds similar to what happens to me when it can't access our network license server. It just stops on the first file with no error message. Normally, when I'm connected on our network it can find the server and it compiles. Perhaps you are having a similar issue. I just did a quick test and it is working for me. Please commit the change to the post build script to your branch referenced in this pull request (master branch of https://github.com/pradeep-gr/mbed-os5-onsemi.git). I definitely recommend you run all the tests and confirm it is all working. |
I ran tests manually using IAR compiler on the branch for the PR (with the change previously mentioned above), plus the master branch. I get 17 errors/fails on this PR branch, but only 1 on master (unrelated issue). There seems to be a fundamental issue in the IAR linker file that is causing these failures. The only substantive differences that I see with the new linker file are the following:
previously it was:
now:
@pradeep-gr Can you investigate the map files before and after this change and see if the placement of the heap and stack is the problem? here are the tests that are failing. I know that many of these are very dependent on RAM allocation.
|
Have you found anything? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is a summary of a few critical fixes we found. This PR should be good to go once these fixes are made.
|
||
/* Handle initialization */ | ||
do not initialize { section .noinit }; | ||
define region RAM_region = mem:[from __ICFEDIT_region_IRAM1_start__ to __ICFEDIT_region_IRAM1_end__] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seem to be two critical problems that are causing all the tests to fail. The first is that the stack is not getting placed at the end of RAM. The second issue is that the RAM Vector area is not getting allocated, and the heap is clobbering it.
Creating regions for these sections fixes this. There might be a more elegant solution, but this works.
define region RAM_VECTOR_region = mem:[from __ICFEDIT_region_IRAM3_start__ to __ICFEDIT_region_IRAM3_start__ + 0x90 - 1];
define region RAM_region = mem:[from __ICFEDIT_region_IRAM3_start__ + 0x90 to __ICFEDIT_region_IRAM3_end__]
| mem:[from __ICFEDIT_region_IRAM2_start__ to __ICFEDIT_region_IRAM2_end__]
| mem:[from __ICFEDIT_region_IRAM1_start__ to __ICFEDIT_region_IRAM1_end__ - __ICFEDIT_size_cstack__ ];
define region CSTACK_region = mem:[from __ICFEDIT_region_IRAM1_end__ - __ICFEDIT_size_cstack__ + 1 to __ICFEDIT_region_IRAM1_end__];
define overlay MIBOVERLAY { section MIBSECTION }; | ||
|
||
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; | ||
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To allocate room for the RAM_VECTORS, define a block similar to CSTACK and HEAP.
define block RAM_VECTORS with alignment = 8, size = 0x90 { };
|
||
place in RAM_ALL { readwrite }; | ||
place in RAM_ALL { block HEAP }; | ||
place in RAM_region { readwrite, block HEAP, section XHEAP, readonly code section EXECINRAM, overlay MIBOVERLAY, readwrite section MIBENDSECTION, block CSTACK}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the RAM_VECTORS and CSTACK regions...
place at start of RAM_VECTOR_region {block RAM_VECTORS};
place in RAM_region { readwrite, block HEAP, section XHEAP, readonly code section EXECINRAM, overlay MIBOVERLAY, readwrite section MIBENDSECTION};
place at end of CSTACK_region { block CSTACK };
@maclobdell, does using the IAR 7.80.2 version fix these linker script problems? We had a bad version go out and you have to be at 7.80.2 or newer to avoid it. I sent you a quick phone email on this but didn't have a chance to follow-up until now. If it's more than this, let me know. Jake is back in the office now so we can pick up our progress on mbed. |
@danclement The linker file used to build mbed OS for this target is within mbed os itself. So the changes I listed are needed. It is not related to the IAR IDE version, however you might also supply the linker file with your support files with IAR too. |
@pradeep-gr Could you respond to @maclobdell's request for changes? |
Generated separate pull request to hasten the requested changes. #4813 should replace this. |
binary output file when more than 316K binary is generated. Need updated daplink bootloader to flash >316K binary file by drag n drop.Refer pull request generated for flashalgo and daplink repo for more info.IAR lnker script modified for flash merge-640K and format changed as per IAR requirement.
superseded by #4813, so closing this one. |
Description
Dual flash and Hex file support added
Status
READY
Related PRs
https://github.com/maclobdell/FlashAlgo/pull/2
https://github.com/maclobdell/DAPLink/pull/9
Deploy notes
Build output will be hex file. Post build script will insert FIB, User trim and trims gap.
Post script generates hex and binary file. Binary file required if user uses boot loader to download.
Steps to test or reproduce
Build using 'mbed test --compile'