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

STM32F722ZE port #15153

Merged
merged 4 commits into from
Nov 17, 2021
Merged

STM32F722ZE port #15153

merged 4 commits into from
Nov 17, 2021

Conversation

bakatrouble
Copy link
Contributor

@bakatrouble bakatrouble commented Oct 26, 2021

Summary of changes

Add Nucleo STM32F722ZE port

Impact of changes

Migration actions required

Documentation

Add board page


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers


@bakatrouble
Copy link
Contributor Author

bakatrouble commented Oct 26, 2021

When I run mbed compile, I'm getting googletest errors:

[mbed] Working path "/home/user/dev/cpp/mbed-os" (program)
[mbed] WARNING: Could not find mbed program in current path "/home/user/dev/cpp/mbed-os".
       You can fix this by calling "mbed new ." in the root of your program.
---
[mbed] Detected "NUCLEO_F722ZE" connected to "/run/media/bakatrouble/NODE_F722ZE" and using com port "/dev/ttyACM0"
[Warning] @,: Compiler version mismatch: Have 11.2.0; expected version >= 9.0.0 and < 10.0.0
Building project mbed-os (NUCLEO_F722ZE, GCC_ARM)
Scan: mbed-os
Compile [  0.1%]: CMakeCXXCompilerId.cpp
Compile [  0.2%]: gmock-pp_test.cc
Compile [  0.3%]: CMakeCCompilerId.c
Compile [  0.4%]: gmock-port_test.cc
Compile [  0.5%]: gmock_main.cc
Compile [  0.6%]: gmock-cardinalities.cc
Compile [  0.7%]: gmock_ex_test.cc
Compile [  0.8%]: sample1.cc
Compile [  0.9%]: sample2.cc
Compile [  0.9%]: gmock.cc
Compile [  1.0%]: gmock-internal-utils.cc
Compile [  1.1%]: gmock_stress_test.cc
[Error] gmock_stress_test.cc@41,28: 'ThreadWithParam' has not been declared in 'testing::internal'
[Error] gmock_stress_test.cc@58,6: variable or field 'JoinAndDelete' declared void
[Error] gmock_stress_test.cc@58,20: 'ThreadWithParam' was not declared in this scope; did you mean 'TestWithParam'?
[Error] gmock_stress_test.cc@58,37: expected primary-expression before '>' token
[Error] gmock_stress_test.cc@58,40: 't' was not declared in this scope
[Error] gmock_stress_test.cc@133,3: 'ThreadWithParam' was not declared in this scope; did you mean 'TestWithParam'?
[Error] gmock_stress_test.cc@133,31: expected primary-expression before '>' token
[Error] gmock_stress_test.cc@133,34: expected primary-expression before 'const'
[Error] gmock_stress_test.cc@139,17: 't' was not declared in this scope
[Error] gmock_stress_test.cc@139,3: 'JoinAndDelete' was not declared in this scope
[Warning] gmock_stress_test.cc@132,22: unused variable 'param' [-Wunused-variable]
[Error] gmock_stress_test.cc@187,3: 'ThreadWithParam' was not declared in this scope; did you mean 'TestWithParam'?
[Error] gmock_stress_test.cc@187,26: expected primary-expression before '*' token
[Error] gmock_stress_test.cc@187,27: expected primary-expression before '>' token
[Error] gmock_stress_test.cc@187,30: expected primary-expression before 'const'
[Error] gmock_stress_test.cc@190,17: 't' was not declared in this scope
[Error] gmock_stress_test.cc@190,3: 'JoinAndDelete' was not declared in this scope
[Error] gmock_stress_test.cc@207,3: 'ThreadWithParam' was not declared in this scope; did you mean 'TestWithParam'?
[Error] gmock_stress_test.cc@207,24: expected primary-expression before '>' token
[Error] gmock_stress_test.cc@207,27: 'threads' was not declared in this scope; did you mean 'read'?
[Error] gmock_stress_test.cc@210,22: 'ThreadWithParam' does not name a type; did you mean 'TestWithParam'?
[Error] gmock_stress_test.cc@210,43: expected primary-expression before '>' token
[Warning] gmock_stress_test.cc@210,72: left operand of comma operator has no effect [-Wunused-value]
[Error] gmock_stress_test.cc@217,5: 'JoinAndDelete' was not declared in this scope
[ERROR] ./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:41:28: error: 'ThreadWithParam' has not been declared in 'testing::internal'
   41 | using ::testing::internal::ThreadWithParam;
      |                            ^~~~~~~~~~~~~~~
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:58:6: error: variable or field 'JoinAndDelete' declared void
   58 | void JoinAndDelete(ThreadWithParam<T>* t) {
      |      ^~~~~~~~~~~~~
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:58:20: error: 'ThreadWithParam' was not declared in this scope; did you mean 'TestWithParam'?
   58 | void JoinAndDelete(ThreadWithParam<T>* t) {
      |                    ^~~~~~~~~~~~~~~
      |                    TestWithParam
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:58:37: error: expected primary-expression before '>' token
   58 | void JoinAndDelete(ThreadWithParam<T>* t) {
      |                                     ^
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:58:40: error: 't' was not declared in this scope
   58 | void JoinAndDelete(ThreadWithParam<T>* t) {
      |                                        ^
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc: In function 'void testing::{anonymous}::TestConcurrentCallsOnSameObject(testing::{anonymous}::Dummy)':
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:133:3: error: 'ThreadWithParam' was not declared in this scope; did you mean 'TestWithParam'?
  133 |   ThreadWithParam<Helper1Param>* const t =
      |   ^~~~~~~~~~~~~~~
      |   TestWithParam
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:133:31: error: expected primary-expression before '>' token
  133 |   ThreadWithParam<Helper1Param>* const t =
      |                               ^
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:133:34: error: expected primary-expression before 'const'
  133 |   ThreadWithParam<Helper1Param>* const t =
      |                                  ^~~~~
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:139:17: error: 't' was not declared in this scope
  139 |   JoinAndDelete(t);
      |                 ^
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:139:3: error: 'JoinAndDelete' was not declared in this scope
  139 |   JoinAndDelete(t);
      |   ^~~~~~~~~~~~~
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:132:22: warning: unused variable 'param' [-Wunused-variable]
  132 |   const Helper1Param param = { &foo, &count1 };
      |                      ^~~~~
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc: In function 'void testing::{anonymous}::TestPartiallyOrderedExpectationsWithThreads(testing::{anonymous}::Dummy)':
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:187:3: error: 'ThreadWithParam' was not declared in this scope; did you mean 'TestWithParam'?
  187 |   ThreadWithParam<MockFoo*>* const t =
      |   ^~~~~~~~~~~~~~~
      |   TestWithParam
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:187:26: error: expected primary-expression before '*' token
  187 |   ThreadWithParam<MockFoo*>* const t =
      |                          ^
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:187:27: error: expected primary-expression before '>' token
  187 |   ThreadWithParam<MockFoo*>* const t =
      |                           ^
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:187:30: error: expected primary-expression before 'const'
  187 |   ThreadWithParam<MockFoo*>* const t =
      |                              ^~~~~
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:190:17: error: 't' was not declared in this scope
  190 |   JoinAndDelete(t);
      |                 ^
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:190:3: error: 'JoinAndDelete' was not declared in this scope
  190 |   JoinAndDelete(t);
      |   ^~~~~~~~~~~~~
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc: In member function 'virtual void testing::{anonymous}::StressTest_CanUseGMockWithThreads_Test::TestBody()':
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:207:3: error: 'ThreadWithParam' was not declared in this scope; did you mean 'TestWithParam'?
  207 |   ThreadWithParam<Dummy>* threads[kTestThreads] = {};
      |   ^~~~~~~~~~~~~~~
      |   TestWithParam
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:207:24: error: expected primary-expression before '>' token
  207 |   ThreadWithParam<Dummy>* threads[kTestThreads] = {};
      |                        ^
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:207:27: error: 'threads' was not declared in this scope; did you mean 'read'?
  207 |   ThreadWithParam<Dummy>* threads[kTestThreads] = {};
      |                           ^~~~~~~
      |                           read
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:210:22: error: 'ThreadWithParam' does not name a type; did you mean 'TestWithParam'?
  210 |     threads[i] = new ThreadWithParam<Dummy>(test_routines[i % kRoutines],
      |                      ^~~~~~~~~~~~~~~
      |                      TestWithParam
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:210:43: error: expected primary-expression before '>' token
  210 |     threads[i] = new ThreadWithParam<Dummy>(test_routines[i % kRoutines],
      |                                           ^
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:210:72: warning: left operand of comma operator has no effect [-Wunused-value]
  210 |     threads[i] = new ThreadWithParam<Dummy>(test_routines[i % kRoutines],
      |                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~^
./cmake-build-debug/_deps/googletest-src/googlemock/test/gmock_stress_test.cc:217:5: error: 'JoinAndDelete' was not declared in this scope
  217 |     JoinAndDelete(threads[i]);
      |     ^~~~~~~~~~~~~

[mbed] ERROR: "/usr/bin/python2" returned error.
       Code: 1
       Path: "/home/user/dev/cpp/mbed-os"
       Command: "/usr/bin/python2 -u /home/user/dev/cpp/mbed-os/tools/make.py -t GCC_ARM -m NUCLEO_F722ZE --source . --build ./BUILD/NUCLEO_F722ZE/GCC_ARM"
       Tip: You could retry the last command with "-v" flag for verbose output
---

Can someone by any chance help me with that?

@bakatrouble bakatrouble changed the title STM32F722ZE port WIP STM32F722ZE port Oct 26, 2021
@ciarmcom ciarmcom requested review from a team October 26, 2021 09:00
@ciarmcom
Copy link
Member

@bakatrouble, thank you for your changes.
@ARMmbed/team-st-mcd @ARMmbed/mbed-os-maintainers please review.

Copy link
Collaborator

@jeromecoutant jeromecoutant left a comment

Choose a reason for hiding this comment

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

Hi
For me this is nice work :-)
Remove patches in tools directories as they are not allowed any more.
I will see if I could find a nucleo around me.

targets/targets.json Outdated Show resolved Hide resolved
targets/targets.json Outdated Show resolved Hide resolved
@bakatrouble
Copy link
Contributor Author

Seems like the issue was in the CLion CMake integration.
Once I've closed it and opened the project in VSCode, build started progressing further.

@bakatrouble
Copy link
Contributor Author

bakatrouble commented Oct 26, 2021

Now I'm getting an error in the emac driver, although EMAC is not listed in device_has_add array:

[Error] stm32f7_eth_conf.c@20,22: unknown type name 'ETH_HandleTypeDef'; did you mean 'RTC_HandleTypeDef'?
[DEBUG] Return: 1
[DEBUG] Output: ./connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/stm32f7_eth_conf.c:20:22: error: unknown type name 'ETH_HandleTypeDef'; did you mean 'RTC_HandleTypeDef'?
[DEBUG] Output:    20 | void _eth_config_mac(ETH_HandleTypeDef *heth)
[DEBUG] Output:       |                      ^~~~~~~~~~~~~~~~~
[DEBUG] Output:       |                      RTC_HandleTypeDef

Am I missing some kind of switch somewhere?

@jeromecoutant
Copy link
Collaborator

Now I'm getting an error in the emac driver, although EMAC is not listed in device_has_add array:
Am I missing some kind of switch somewhere?

OK, all other STM32F7 was supporting ETHERNET, not STM32F722...
So you need to add a protection in
https://github.com/ARMmbed/mbed-os/blob/master/connectivity/drivers/emac/TARGET_STM/TARGET_STM32F7/stm32f7_eth_conf.c

#ifdef ETH
... // _eth_config_mac
#endif

@jeromecoutant
Copy link
Collaborator

You will also need to protect this line:
https://github.com/ARMmbed/mbed-os/blob/master/targets/TARGET_STM/TARGET_STM32F7/spi_api.c#L61

#if defined SPI6_BASE
        case SPI_6:
#endif

@bakatrouble
Copy link
Contributor Author

bakatrouble commented Oct 26, 2021

Thanks, now it's building suiccessfully.
Now most tests are failing with code 0x80010133 (Mutex: 0x********, Unknown)
There are some other errors, but this is the most common
Any advice on how to investigate those?

https://github.com/ARMmbed/mbed-os/files/7425204/tests.log

jeromecoutant added a commit to jeromecoutant/mbed that referenced this pull request Oct 27, 2021
Copy link
Collaborator

@jeromecoutant jeromecoutant left a comment

Choose a reason for hiding this comment

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

FLASH support has to be updated to support STM32F722

You can check/cherry pick my commits from
https://github.com/jeromecoutant/mbed/tree/DEV_STM32F722

@jeromecoutant
Copy link
Collaborator

[] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[x] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Check 'Patch update'

Thx

bakatrouble pushed a commit to bakatrouble/mbed-os that referenced this pull request Oct 27, 2021
@bakatrouble
Copy link
Contributor Author

Thanks a lot, now all tests except for hal-tests-tests-mbed_hal-mpu (MPU - stack fault) are running correcty

@bakatrouble bakatrouble marked this pull request as ready for review October 28, 2021 13:39
Copy link
Collaborator

@jeromecoutant jeromecoutant left a comment

Choose a reason for hiding this comment

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

MPU test is OK on my side!

PS: maybe you should squash commits related to F722 into 1, and make a separate commit for each other STM32F7 patches ?

@bakatrouble
Copy link
Contributor Author

PS: maybe you should squash commits related to F722 into 1, and make a separate commit for each other STM32F7 patches ?

Done

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 16, 2021

CI started

@mbed-ci
Copy link

mbed-ci commented Nov 16, 2021

Jenkins CI Test : ✔️ SUCCESS

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️

@0xc0170 0xc0170 merged commit ae5c9ec into ARMmbed:master Nov 17, 2021
@mergify mergify bot removed the ready for merge label Nov 17, 2021
@mbedmain mbedmain added release-version: 6.15.1 Release-pending and removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Nov 22, 2021
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.

6 participants