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

STM32L5 : add DISCO-L562QE board support #12338

Merged
merged 3 commits into from
Feb 17, 2020

Conversation

jeromecoutant
Copy link
Collaborator

Summary of changes

New board addition : DISCO_L562QE

https://www.st.com/en/evaluation-tools/stm32l562e-dk.html

  • QSPI support OK
  • STMOD_cellular support OK

NB: Trust Zone is not enabled yet in this version

@ARMmbed/team-st-mcd
@MarceloSalazar
@PLFSTM

Impact of changes

Migration actions required

Documentation


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


@ciarmcom ciarmcom requested a review from a team January 30, 2020 16:00
@ciarmcom
Copy link
Member

@jeromecoutant, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

Copy link
Member

@bulislaw bulislaw left a comment

Choose a reason for hiding this comment

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

Couple of questions.

@@ -150,5 +150,9 @@ void mbed_sdk_init()
#endif /* ! MBED_CONF_TARGET_LSE_AVAILABLE */
#endif /* DEVICE_RTC */

#if defined (MBED_CONF_TARGET_STMOD_SEL) // DISCO_L562QE
Copy link
Member

Choose a reason for hiding this comment

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

That worries me a bit and it's a bit confusing. stmod_select is only defined for this one DISCO board (not even family or SoC). Here we are conditionally compiling the call to it based on MBED_CONF_TARGET_STMOD_SEL and the function is defined as:

void stmod_select(void)
{
    DigitalOut SEL_12(PF_11);
    DigitalOut SEL_34(PF_12);

#if (MBED_CONF_TARGET_STMOD_SEL) // UART selection
    SEL_12 = 1;
    SEL_34 = 1;
#else // SPI selection
    SEL_12 = 0;
    SEL_34 = 0;
#endif
}

but it's not called anywhere else. I guess it's acceptable, maybe even desirable, for the build to fail if user defines the macro, but the board doesn't provide the function. But maybe it's worth simplifying it a bit? The stmod_select will only be called when the macro is defined, maybe the function it doesn't need to have the conditional block? Just a comment saying it's only called when the macro is defined and it will force the UART to be selected?

Choose a reason for hiding this comment

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

If possible, I'd suggest tweaking the configuration here to pick up the pin names from the STMOD's mbed_lib.json

Copy link
Collaborator Author

@jeromecoutant jeromecoutant Feb 7, 2020

Choose a reason for hiding this comment

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

@bulislaw
Agree. Will propose a new solution.

@@ -35,6 +25,14 @@
#include "pinmap.h"
#include "PeripheralPins.h"

#include "mbed_trace.h"
Copy link
Member

Choose a reason for hiding this comment

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

Unifying the "tracing/debug/printf" facilities was an item on my TODO list. Do you know what's the cost of enabling it for builds that didn't use it before? For various build profiles?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, unifying the trace facilities was my goal for mbed_trace use.
I didn't check the cost between now (mbed_trace use) and before (mbed_debug use).


// Reset handle internal state
obj->handle.State = HAL_OSPI_STATE_RESET;

// Set default OCTOSPI handle values
obj->handle.Init.DualQuad = HAL_OSPI_DUALQUAD_DISABLE;
obj->handle.Init.MemoryType = HAL_OSPI_MEMTYPE_MICRON;
obj->handle.Init.MemoryType = HAL_OSPI_MEMTYPE_MACRONIX;
Copy link
Member

Choose a reason for hiding this comment

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

That's a generic driver, will that work ok across?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You're right, I changed this only while code reviewing.
I am checking with experts the real impact of this.

Copy link

@MarceloSalazar MarceloSalazar left a comment

Choose a reason for hiding this comment

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

It would be good to reuse the STMOD config from mbed_lib.json

0xc0170
0xc0170 previously requested changes Feb 5, 2020
/* mbed Microcontroller Library
*******************************************************************************
* Copyright (c) 2018, STMicroelectronics
* All rights reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

lets add SPDX identifiers to new files

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

"value": 1
}
},
"overrides": { "lpticker_delay_ticks": 0 },
Copy link
Contributor

Choose a reason for hiding this comment

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

please fix formatting as the rest of this json (new line should be here?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@0xc0170 0xc0170 added the release-version: 6.0.0-alpha-2 Second pre-release version of 6.0.0 label Feb 7, 2020
@mergify mergify bot dismissed 0xc0170’s stale review February 10, 2020 09:25

Pull request has been modified.

@jeromecoutant
Copy link
Collaborator Author

@bulislaw @0xc0170
could you check updates ?
Thx

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 11, 2020

Can you attach test logs for this new target?

@jeromecoutant
Copy link
Collaborator Author

Can you attach test logs for this new target?

Yes
report__Check_ARM_DISCO_L562QE__2020_02_10_09_58.txt
report__Check_GCC_DISCO_L562QE__2020_02_10_10_58.txt
report__Check_IAR_DISCO_L562QE__2020_02_10_11_57.txt

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 11, 2020

CI started

0xc0170
0xc0170 previously approved these changes Feb 11, 2020
@mergify mergify bot added needs: CI and removed needs: review labels Feb 11, 2020
@mbed-ci
Copy link

mbed-ci commented Feb 11, 2020

Test run: FAILED

Summary: 1 of 4 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_build-IAR

@mergify mergify bot added needs: work and removed needs: CI labels Feb 11, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 13, 2020

CI restarted

@mbed-ci
Copy link

mbed-ci commented Feb 13, 2020

Test run: FAILED

Summary: 3 of 11 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_mbed2-build-GCC_ARM
  • jenkins-ci/mbed-os-ci_mbed2-build-ARM
  • jenkins-ci/mbed-os-ci_mbed2-build-IAR

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 13, 2020

@jeromecoutant there are errors in mbed2 building:

[DEBUG] Output: /builds/ws/mbed-os-ci_mbed2-build-ARM@2/mbed-os/targets/TARGET_STM/qspi_api.c:28:10: fatal error: 'mbed_trace.h' file not found
[DEBUG] Output: #include "mbed_trace.h"

Although there is no mbed 2 release and I'll question this CI stage, what shall we do?

@mergify mergify bot dismissed 0xc0170’s stale review February 14, 2020 16:52

Pull request has been modified.

@jeromecoutant
Copy link
Collaborator Author

Hi
QSPI debug feature will be part of an other PR
CI restarted

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 17, 2020

CI restarted

@mbed-ci
Copy link

mbed-ci commented Feb 17, 2020

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 3
Build artifacts

@0xc0170 0xc0170 removed the needs: CI label Feb 17, 2020
@0xc0170 0xc0170 merged commit c12b433 into ARMmbed:master Feb 17, 2020
@jeromecoutant jeromecoutant deleted the PR_STM32L5_DISCO branch February 17, 2020 11:54
@jeromecoutant
Copy link
Collaborator Author

QSPI debug feature will be part of an other PR

See #12451

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-version: 6.0.0-alpha-2 Second pre-release version of 6.0.0 scope: new-target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants