Skip to content

[STM32L4] Update ARM_MICRO startup files #1554

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 24, 2016
Merged

[STM32L4] Update ARM_MICRO startup files #1554

merged 2 commits into from
Mar 24, 2016

Conversation

bcostm
Copy link
Contributor

@bcostm bcostm commented Feb 19, 2016

Fix issue #1348

; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>

Stack_Size EQU 0x00000400
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this removal for uLib STD?

Copy link
Contributor

Choose a reason for hiding this comment

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

MY question could be answered by describing the change in the commit. I can see here removal of Stack_size, Stack_mem, adjusting heap size and changing heap_limit calculation. PLease add more details for this changeset - why, how..

@bcostm
Copy link
Contributor Author

bcostm commented Feb 21, 2016

This change has been done to fix some issues with the stack/heap. I just checked that it worked but I didn't do this modification. @betzw can you please answer to Martin ? Because I also asked myself how is it possible to remove the stack size and heap limit in this file without problem...

@betzw
Copy link
Contributor

betzw commented Feb 22, 2016

Regarding heap,
with the old startup file the result after linking looked like this:

   __heap_limit                             0x10007c00   Number         0  startup_stm32l476xx.o ABSOLUTE
   __initial_sp                             0x10008000   Number         0  startup_stm32l476xx.o ABSOLUTE

...

   __heap_base                              0x20002e68   Data           0  startup_stm32l476xx.o(HEAP)

so the _heap_limit was below the __heap_baseand even in a different memory bank, which for sure was a mistake. Furthermore the limit seemed to be a constant number while the base seemed to be a variable of size zero, which somehow also looked odd to me too.

Regarding stack,
considering the above numbers I was wondering how to specify for the ARM_TOOLSETs correctly something like: 32K of heap somewhere in the RAM bank starting at 0x20000000 and 16K stack at the end of RAM bank starting at 0x10000000. The result of my investigations is reflected by the changes in this PR made to file startup_stm32l476xx.s: where both heap-limit & heap-base are calculated by the linker (and to me somehow "magically" put in the RAM bank starting at 0x20000000) while I calculated the value of the initial stack pointer as the same constant value as in the old startup file. Regarding the stack size I didn't actually know what exactly to do and exactly which effect the definition of a

Stack_Mem       SPACE   Stack_Size

would have actually had (above all with respect to linking) ... If it actually would reserve Stack_Size of memory at the end of the RAM bank starting at 0x10000000 then we should obviously add the removed lines back to the startup file (but with a stack size of 0x4000, i.e. 16K).

@betzw
Copy link
Contributor

betzw commented Mar 1, 2016

Any feedback?

cc @screamerbg

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 18, 2016

Sorry for the delay, we should look at this changeset for this release (the issue 1561)

cc @sg-

@sg-
Copy link
Contributor

sg- commented Mar 18, 2016

Does this device really have 1M flash and if so why support uARM? http://www.st.com/web/catalog/mmc/FM141/SC1169/SS1580/LN1840/PF260095?icmp=pf260095_pron_pr_feb2015&sc=stm32l476-pr

Please see this proposal #1536

@betzw
Copy link
Contributor

betzw commented Mar 18, 2016

Not sure if your proposal #1536 is about which tool-sets need to be supported (i.e. are required) or just about which tool-set should be the default one.
Currently, this PR is urgent for any of our users who try to use this platform with the online-compiler, so pls. do not let us loose time in useless discussions and lets merge it.
We can always adapt afterwards to any decision you will take regarding required and/or default tool-sets.

cc @nikapov-ST

@sg-
Copy link
Contributor

sg- commented Mar 18, 2016

Why is uARM used by default for a MCU with 1M of flash?

@betzw
Copy link
Contributor

betzw commented Mar 18, 2016

This is not the crucial question here!
It might be just because nobody really cared when starting the port but @bcostm might know better.
@sg- if you want to change the default tool-set for this platform, pls. send a respective PR!
@screamerbg could you pls. help us to get this PR finally merged!

@bcostm
Copy link
Contributor Author

bcostm commented Mar 18, 2016

Since the beginning I use uARM because this is also the default we use in the examples delivered in the STM32Cube packages. We can change it later if it is required.

@star297
Copy link
Contributor

star297 commented Mar 18, 2016

Sam, is it possible to incorporate a selectable drop down on the on-line compiler IDE for the user to select uARM or Standard? Would be quite a nice touch.

@0xc0170
Copy link
Contributor

0xc0170 commented Mar 24, 2016

@sg- if you want to change the default tool-set for this platform, pls. send a respective PR!

We should, as you proposed not as part of this PR.

I'll merge this now, as based on the above comments and the description provided http://www.keil.com/support/docs/3340.htm. Thanks @betzw for providing details.

@0xc0170 0xc0170 merged commit 286b61d into ARMmbed:master Mar 24, 2016
@betzw
Copy link
Contributor

betzw commented Mar 24, 2016

Thanks a lot @0xc0170

@bcostm bcostm deleted the stm32l4_arm_startup_files branch March 25, 2016 11:48
@helmut64
Copy link
Contributor

@betzw I resumed my work on the STM32L4 Disco and Nucleo boards using the mbed online compiler. The current configuration has a 32k heap limit, more memory cannot be alloced via new or malloc. I believe the error is the following line in TOOLCHAIN_ARM_MICRO/startup_stm32l476xx.s for the Disco and Nucleo mbed libraries.
Heap_Size EQU 0x8000 ; 32KB

The correct size should be:
Heap_Size EQU 0x18000 ; 96KB

Regards Helmut

deepakvenugopal added a commit to deepakvenugopal/mbed-os that referenced this pull request Feb 9, 2018
…changes from c9bf20f..43c7ec2

43c7ec2 Merge branch 'release_internal' into release_external
ed76459 Merge pull request ARMmbed#1558 from ARMmbed/IOTTHD-2195
8d3bcb7 Add new function to unit tests
56f66a4 Review correction
8b7d018 Move indirect queue size public API to net_interface
d877c9e Review corrections
c25e476 Remove Eclipse project files for external release
d51f442 Merge branch 'release_internal' into release_external
135c48d Increase Thread SED buffer size for big packets
70931a7 Fix indirect queue packet ordering
10e51a4 API for changing Thread SED parent buffer size
6122d24 dereference null value issue fixed. (ARMmbed#1557)
d1378dc Clear IPv6 neighbor cache in partition change (ARMmbed#1554)
7610e91 Child neighbor entry updates (ARMmbed#1550)
c727295 cleared neighbours with child address that are not ours (ARMmbed#1549)
80b4d72 Thread partition merge mode TLV change (ARMmbed#1546)
edd7599 RLOC was updated before clearing child info (ARMmbed#1547)
a666056 router short address set to 0xfffe for non routers (ARMmbed#1543)
759ab05 delete route set and link set entries for a router ID (ARMmbed#1540)
23a1265 REED advertisement handling (Thread spec 5.16.3): (ARMmbed#1535)
0a32cb4 added active and pending timestamps to child update response (ARMmbed#1533)
d0eec80 Fix error case memory leak (ARMmbed#1537)
da9860f Pending set after link sync (ARMmbed#1526)
ffa1569 Thread router network data update after link sync (ARMmbed#1530)
3b46d8d Fix defects found by coverity (ARMmbed#1529)
3a57101 Fix compiler warnings and update traces (ARMmbed#1523)
c288227 Add extension check for partition weight drop in parent selection (ARMmbed#1521)
d8dea28 network data cleared after router forms new partition (ARMmbed#1525)
44a85e5 removed router flagging for thread_management_server file (ARMmbed#1524)
1cbced9 Merge pull request ARMmbed#1520 from ARMmbed/IOTTHD-2105_2
3d07365 Review corrections to network data clearing
22a0375 Clear network data from lost children
ffd8517 added a new thread management function (ARMmbed#1519)
80af9cb Thread BR network data clearing (ARMmbed#1518)
5a6f6b5 thread nvm valgrind uninitialized data fix (ARMmbed#1517)
d5e2198 Add API for partition weighting set (ARMmbed#1513)
8811d6f multicast forwarding scope changed and address registration updated. (ARMmbed#1516)
c277384 printf to tr_info (ARMmbed#1515)
bb21264 Thread combined nvm test (ARMmbed#1507)
76f7725 Primary BBR fixes from interop (ARMmbed#1512)
12ed5ab FHSS unit test: fixed fhss mac interface test (cherry picked from commit 805eb42e4416b00cc018dc32dceb353d0b6c8bb6)
dd21ea9 Remvoed unnecessary trace print's.
cb6e78b FHSS unit test: fixed fhss beacon tasklet test (cherry picked from commit abe6d671b058f4f069741eab24d51e4d62d550b0)
237b3d4 Fhss info print (ARMmbed#1486)
0f39a47 FHSS: Do not update synch monitor right after superframe change (cherry picked from commit 99d50ad9d7f8dad80f10c2a4303f4e75ab31a3c2)
c9a098f Fixed Timeoout force which actually never generate timeout.
957c7fb Pana server and client update:
ae230e5 FHSS: Update Beacon synch info in critical state
84bd8a4 FHSS: Synchronization must be done in critical state
fb1b163 Pan coordinator blacklist update
39fe6ba Added missing HAVE_RPL compiler flag
16a1bc5 MLE bootsrap and message timeout update
eeb2d39 enable BBR to support multicast registration in non   commercial networks (ARMmbed#1509)
4ea2bf8 uri modified. (ARMmbed#1510)
f443853 timeout corrected for neighbour entry (ARMmbed#1508)
ea93c1f Thread dev conf taken use (ARMmbed#1503)
5d5b239 bug fix in bbr start (ARMmbed#1505)
8dbd521 commented a trace. (ARMmbed#1504)
145dbdf device conf copy fix (ARMmbed#1502)
f60268f eid&random mac moved to device conf struct (ARMmbed#1497)
df18635 Let MAC choose address when mesh forwarding
42f916b fixed BBR stop to remove network data and routing information (ARMmbed#1500)
e058c2a pbbr changes (ARMmbed#1499)
1ece307 Merge pull request ARMmbed#1485 from ARMmbed/merge_release_back
dda8164 thread address handling updated. (ARMmbed#1496)
1dc21a1 thread extension fixes. (ARMmbed#1495)
543fe98 Merge branch 'release_internal'
bade70e Dua req changes (ARMmbed#1494)
1979df8 added status to MLR response and implemeted BMLR.ntf multicast. (ARMmbed#1492)
1807c01 mle class initialisation (ARMmbed#1488)
d809831 Merge pull request ARMmbed#1479 from ARMmbed/merge_release_to_master
bce812d Update license to Thread test file (ARMmbed#1483)
aaa4b1f Revert eclipse file removal

git-subtree-dir: features/nanostack/FEATURE_NANOSTACK/sal-stack-nanostack
git-subtree-split: 43c7ec2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants