Skip to content

ST-DISCO_L475VG_IOT01A: Improve SRAM use for IAR toolchain #5844

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 1 commit into from
Jan 23, 2018

Conversation

adustm
Copy link
Member

@adustm adustm commented Jan 12, 2018

Description

DISCO_L475VG_IOT01A has 128 k of SRAM (32k in SRAM2 + 96k in SRAM1)
At the moment, for IAR toolchain, SRAM2 only contains the nvic vector.
With this PR:
Use the entire SRAM2 with NVIC buffer + stack
Increase HEAP size to 0x10000 in SRAM1
Increase the available SRAM1 by 0x2000

Status

READY

Todos

  • Tests

Steps to test or reproduce

I'm working on the wifi driver and I've had memory mapping issues with mbed-tls-client example

  Use the entire SRAM2 with NVIC buffer + stack
  Increase HEAP size to 0x10000 in SRAM1
  Increase the available SRAM1 by 0x2000
@adustm
Copy link
Member Author

adustm commented Jan 12, 2018

Local test report:

+-------------------------+---------------------+------------------------------------------------------------------------------+--------+--------------------+-------------+
| target                  | platform_name       | test suite                                                                   | result | elapsed_time (sec) | copy_method |
+-------------------------+---------------------+------------------------------------------------------------------------------+--------+--------------------+-------------+
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | features-frameworks-utest-tests-unit_tests-basic_test                        | OK     | 15.93              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | features-frameworks-utest-tests-unit_tests-basic_test_default                | OK     | 15.83              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | features-frameworks-utest-tests-unit_tests-case_async_validate               | OK     | 17.61              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | features-frameworks-utest-tests-unit_tests-case_control_async                | OK     | 23.88              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | features-frameworks-utest-tests-unit_tests-case_control_repeat               | OK     | 17.91              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | features-frameworks-utest-tests-unit_tests-case_selection                    | OK     | 15.77              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | features-frameworks-utest-tests-unit_tests-case_setup_failure                | OK     | 16.24              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | features-frameworks-utest-tests-unit_tests-case_teardown_failure             | OK     | 16.29              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | features-frameworks-utest-tests-unit_tests-control_type                      | OK     | 16.61              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | features-frameworks-utest-tests-unit_tests-minimal_async_scheduler           | OK     | 16.74              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | features-frameworks-utest-tests-unit_tests-minimal_scheduler                 | OK     | 17.33              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | features-frameworks-utest-tests-unit_tests-test_assertion_failure_test_setup | OK     | 15.54              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | features-frameworks-utest-tests-unit_tests-test_setup_case_selection_failure | OK     | 15.63              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | features-frameworks-utest-tests-unit_tests-test_setup_failure                | OK     | 15.24              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | features-tests-filesystem-heap_block_device                                  | OK     | 17.52              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | features-tests-filesystem-mbr_block_device                                   | OK     | 16.83              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | features-tests-filesystem-util_block_device                                  | OK     | 16.3               | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-events-queue                                                           | OK     | 23.17              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-events-timing                                                          | OK     | 76.27              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-integration-basic                                                      | OK     | 14.85              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_drivers-c_strings                                                 | OK     | 17.67              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_drivers-dev_null                                                  | OK     | 16.85              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_drivers-echo                                                      | OK     | 17.72              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_drivers-flashiap                                                  | OK     | 16.22              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_drivers-generic_tests                                             | OK     | 16.13              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_drivers-lp_ticker                                                 | OK     | 22.15              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_drivers-lp_timeout                                                | OK     | 24.96              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_drivers-lp_timer                                                  | OK     | 20.59              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_drivers-race_test                                                 | OK     | 17.1               | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_drivers-rtc                                                       | OK     | 26.11              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_drivers-sleep_lock                                                | OK     | 15.8               | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_drivers-stats                                                     | OK     | 16.26              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_drivers-stl_features                                              | OK     | 16.4               | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_drivers-ticker                                                    | OK     | 44.85              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_drivers-timeout                                                   | OK     | 27.1               | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_drivers-timer                                                     | OK     | 23.37              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_functional-callback                                               | OK     | 17.55              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_functional-callback_big                                           | OK     | 17.58              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_functional-callback_small                                         | OK     | 17.46              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_functional-functionpointer                                        | OK     | 15.9               | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_hal-flash                                                         | OK     | 17.05              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_hal-lp_ticker                                                     | OK     | 24.66              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_hal-lp_us_tickers                                                 | OK     | 17.16              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_hal-rtc_time                                                      | OK     | 17.49              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_hal-rtc_time_conv                                                 | OK     | 38.69              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_hal-sleep_manager                                                 | OK     | 15.47              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_hal-sleep_manager_racecondition                                   | OK     | 23.6               | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_hal-ticker                                                        | OK     | 27.55              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbed_platform-singletonptr                                             | OK     | 15.71              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbedmicro-mbed-attributes                                              | OK     | 17.55              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbedmicro-mbed-call_before_main                                        | OK     | 14.79              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbedmicro-mbed-cpp                                                     | OK     | 14.94              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbedmicro-mbed-div                                                     | OK     | 14.91              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbedmicro-mbed-static_assert                                           | OK     | 15.38              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbedmicro-rtos-mbed-basic                                              | OK     | 27.05              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbedmicro-rtos-mbed-circularbuffer                                     | OK     | 21.76              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbedmicro-rtos-mbed-condition_variable                                 | OK     | 16.24              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbedmicro-rtos-mbed-event_flags                                        | OK     | 19.42              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbedmicro-rtos-mbed-heap_and_stack                                     | OK     | 16.33              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbedmicro-rtos-mbed-mail                                               | OK     | 21.12              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbedmicro-rtos-mbed-malloc                                             | OK     | 36.66              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbedmicro-rtos-mbed-memorypool                                         | OK     | 23.31              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbedmicro-rtos-mbed-mutex                                              | OK     | 20.39              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbedmicro-rtos-mbed-queue                                              | OK     | 19.0               | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbedmicro-rtos-mbed-rtostimer                                          | OK     | 18.41              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbedmicro-rtos-mbed-semaphore                                          | OK     | 20.61              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbedmicro-rtos-mbed-signals                                            | OK     | 22.81              | default     |
| DISCO_L475VG_IOT01A-IAR | DISCO_L475VG_IOT01A | tests-mbedmicro-rtos-mbed-threads                                            | OK     | 32.07              | default     |
+-------------------------+---------------------+------------------------------------------------------------------------------+--------+--------------------+-------------+

place in SRAM1_region { readwrite, block STACKHEAP };
place in SRAM2_region { };
place in SRAM1_region { readwrite, block HEAP };
place in SRAM2_region { block CSTACK };
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure but shouldn't we add the readwrite keyword ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hello @bcostm Bruno
Your suggestion seemed good to me, but it does not link
It gives a long list of ambigous section match like this one
Error[Lc037]: ambiguous section match: "zi section .bss in main.o" matches more than one pattern "rw" (at line 36 of "C:/MCDGit7/mbed-os/BUILD/tests/DISCO_L475VG_IO T01A/IAR/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L4 75xG/device/TOOLCHAIN_IAR/stm32l475xx.icf") "rw" (at line 37 of "C:/MCDGit7/mbed-os/BUILD/tests/DISCO_L475VG_IO T01A/IAR/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L4 75xG/device/TOOLCHAIN_IAR/stm32l475xx.icf")
Is there any reason for asking this extra readwrite keyword ?

Cheers
Armelle

Copy link
Contributor

Choose a reason for hiding this comment

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

That is correct, readwrite specifies: Place .data, .bss, and .noinit. Therefore the linking error

It is good as it is

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 22, 2018

/morph build

1 similar comment
@cmonr
Copy link
Contributor

cmonr commented Jan 22, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Jan 22, 2018

Build : SUCCESS

Build number : 909
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5844/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build

@cmonr
Copy link
Contributor

cmonr commented Jan 22, 2018

Odd build failure, appears to be unrelated to PR.

Relaunching uvisor test.
/morph uvisor-test

@mbed-ci
Copy link

mbed-ci commented Jan 23, 2018

@cmonr
Copy link
Contributor

cmonr commented Jan 23, 2018

/morph export-build

@mbed-ci
Copy link

mbed-ci commented Jan 23, 2018

@mbed-ci
Copy link

mbed-ci commented Jan 23, 2018

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.

5 participants