Skip to content

STM32F7: Add bootloader support #5821

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 5 commits into from
Jan 23, 2018
Merged

Conversation

bcostm
Copy link
Contributor

@bcostm bcostm commented Jan 10, 2018

Description

  • Add bootloader support to the NUCLEO_F746ZG and NUCLEO_F767ZI platforms
  • Fix issue STM32F7 bootloader does not work #5718 (was related to cache, see questions below)
  • Tested OK on these 2 platforms using mbed-os-example-bootloader example

Status

READY

Migrations

NO

Open questions concerning Cache

  • We tried first to disable the caches using the macros:
SCB_InvalidateICache();
SCB_DisableICache();
SCB_CleanInvalidateDCache();
SCB_DisableDCache();

but it didn't work. Do you know why and what is missing ?

  • We think that the cache activation should be done in another place for example in the platform/mbed_application.c file. What do you think ?

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 10, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Jan 10, 2018

Build : SUCCESS

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

Triggering tests

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

@LMESTM
Copy link
Contributor

LMESTM commented Jan 10, 2018

@0xc0170 - as mentioned by Bruno we have question regarding the cache management of cortex-M7 MCUs

As of now, cache is enabled in targets/TARGET_STM/mbed_overrides.c. But shouldn't this be generic ?
Also in case of bootloader, shoudn't mbed_start_application handle the cache cleaning / disabling before jumping into new application ?

@mbed-ci
Copy link

mbed-ci commented Jan 10, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 10, 2018

As of now, cache is enabled in targets/TARGET_STM/mbed_overrides.c. But shouldn't this be generic ?
Also in case of bootloader, shoudn't mbed_start_application handle the cache cleaning / disabling before jumping into new application ?

Good question, this is not yet covered.

@c1728p9 @bulislaw

@LMESTM generic as handling on architecture level? If it has a cache, do what our specs say (we will review to have this covered)

@mbed-ci
Copy link

mbed-ci commented Jan 10, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 10, 2018

/morph test

@mbed-ci
Copy link

mbed-ci commented Jan 11, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 11, 2018

sync device failed (update st link related ? )

/morph test

@mbed-ci
Copy link

mbed-ci commented Jan 11, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 11, 2018

@bcostm initially it looked like not related sync failure, but might be related - can you reproduce the fialures (sync failues ) for F7 device? same as reported in the test results?

@bcostm
Copy link
Contributor Author

bcostm commented Jan 12, 2018

On my side these tests are FAIL on all STM32F7 boards/toolchains::

tests-netsocket-gethostbyname
tests-netsocket-socket_sigio
tests-netsocket-tcp_echo
tests-netsocket-tcp_hello_world

but these tests are PASS on all STM32F7 boards/toolchains:

features-frameworks-utest-tests-unit_tests-test_setup_case_selection_failure
tests-mbedtls-multi
tests-mbedmicro-mbed-static_assert
features-frameworks-utest-tests-unit_tests-basic_test

PS: I am waiting test results on the master branch to compare.

@bcostm
Copy link
Contributor Author

bcostm commented Jan 15, 2018

I have relaunched the above tests several times using this branch and master branch on all F7 platforms/toolchains: the netsockets tests are unstable (SYNC_FAILED or OK), all the other tests are OK. Can you relaunch the mbed-ci tests ?

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 15, 2018

What is causing the sync failed ?

/morph test

@mbed-ci
Copy link

mbed-ci commented Jan 15, 2018

@mprse
Copy link
Contributor

mprse commented Jan 16, 2018

bcostm:add_BL_nucleo-f746zg branch contains old version of tests-mbed_hal-rtc_time_conv test (it has been recently optimised), but this does not explain why ASSERT fails.
I tried to run it few times on master and on bcostm:add_BL_nucleo-f746zg branch and on both it works.
It looks like there is some inconsistency between host part of the test and mbed part in CI.
I think that at first bcostm:add_BL_nucleo-f746zg should be re-based on current master and we should try again with morph test.

@bcostm bcostm force-pushed the add_BL_nucleo-f746zg branch from d550840 to eed1b8e Compare January 16, 2018 08:11
@bcostm
Copy link
Contributor Author

bcostm commented Jan 16, 2018

Rebase done.

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 16, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Jan 16, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Jan 16, 2018

@mbed-ci
Copy link

mbed-ci commented Jan 16, 2018

@mprse
Copy link
Contributor

mprse commented Jan 16, 2018

It looks like all PASSED, but status is FAILURE...
tests-mbed_hal-rtc_time_conv test issue has been solved (this might be some kind of CI bug).

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 16, 2018

It was unfortunately aborted but results looked good !

/morph test

The mbed_sdk_init can be called either during cold boot or during
application boot after bootloader has been executed.
In case the bootloader has already enabled the cache,
is is needed to not enable it again.
@bcostm
Copy link
Contributor Author

bcostm commented Jan 22, 2018

I can't see the log files. Which test is causing this comm error ?

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 22, 2018

I can't see the log files. Which test is causing this comm error ?

I sent it to you via email, I could not locate them neither via the test log log url.

@bcostm bcostm force-pushed the add_BL_nucleo-f746zg branch from eed1b8e to 4d0535a Compare January 22, 2018 14:13
@bcostm
Copy link
Contributor Author

bcostm commented Jan 22, 2018

As discussed by email, no sync error on my side.

I have upgraded the NUCLEO_F746ZG board with STLink fw V2.J30.M19 and all mbedOS5 tests are PASS for me.

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 23, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Jan 23, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Jan 23, 2018

@mbed-ci
Copy link

mbed-ci commented Jan 23, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 23, 2018

/morph uvisor-test

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 23, 2018

Test passed, updating firmware helped ! 🤞

@raghidmardini
Copy link

raghidmardini commented Jan 23, 2018

I'm seeing an issue with the changes made to the target NUCLEO_F767ZI when constructing an SPI object.

The following code was tested on mbed-os-5.7.3 and the LEDs blinked indefinitely while creating SPI objects.

After updating to the merged commit 4c07c1c, initially the LEDs blinked indefinitely, but after disconnecting the device from power and repowering it, the code hanged at "Constructing SPI" message.

If I undo the changed made to the file targets/TARGET_STM/mbed_overrides.c, the code runs fine again. It seems like the Cache is not enabled correctly.

EDIT: I am using the latest st-link firmware V2J30M19

#include "mbed.h"

DigitalOut led1 (LED1,0);
DigitalOut led2 (LED2,0);
DigitalOut led3 (LED3,0);

int main(){
	while(true){
		led1=!led1;
		wait(0.2);
		led2=!led2;
		wait(0.2);
		led2=!led3;
		wait(0.2);
		printf("Constructing SPI\n\r");
		SPI spi(PC_12, PC_11, PC_10);
		printf("Constructed SPI\n\r");
	}
}

@cmonr
Copy link
Contributor

cmonr commented Jan 23, 2018

@raghidmardini Please open a new issue for this particular problem. In general, pull requests are left alone after its either merged or closed.

However, feel free to reference this pull request.

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.

8 participants