Skip to content

stm32: minor UART fixes for STM32WB and related MCUs #7116

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
Apr 14, 2021

Conversation

dpgeorge
Copy link
Member

No description provided.

So these alternate functions can be parsed by the build scripts and used in
application code.

Signed-off-by: Damien George <[email protected]>
This function includes the UART prescaler in the calculation (if it has
one, eg on H7 and WB MCUs).

Signed-off-by: Damien George <[email protected]>
@dpgeorge dpgeorge merged commit 2ac09c2 into micropython:master Apr 14, 2021
@dpgeorge dpgeorge deleted the stm32-wb55-uart-fixes branch April 14, 2021 00:01
jepler added a commit to jepler/circuitpython that referenced this pull request Aug 27, 2021
.. or, for !MICROPY_ENABLE_FINALISER, before the first block of the pool.

Closes: adafruit#5021
Closes: micropython#7116
Signed-off-by: Jeff Epler <[email protected]>
tannewt pushed a commit to tannewt/circuitpython that referenced this pull request Nov 16, 2022
Add STEMMA_I2C() object to Picos for Cowbells.
dpgeorge pushed a commit to dpgeorge/micropython that referenced this pull request Nov 25, 2022
dpgeorge pushed a commit to dpgeorge/micropython that referenced this pull request Dec 8, 2022
dpgeorge pushed a commit to dpgeorge/micropython that referenced this pull request Dec 8, 2022
Prior to this fix the follow crash occurred.  With a GC layout of:

    GC layout:
      alloc table at 0x3fd80428, length 32001 bytes, 128004 blocks
      finaliser table at 0x3fd88129, length 16001 bytes, 128008 blocks
      pool at 0x3fd8bfc0, length 2048064 bytes, 128004 blocks

Block 128003 is an AT_HEAD and eventually is passed to gc_mark_subtree.
This causes gc_mark_subtree to call ATB_GET_KIND(128004).  When block 1 is
created with a finaliser, the first byte of the finaliser table becomes
0x2, but ATB_GET_KIND(128004) reads these bits as AT_TAIL, and then
gc_mark_subtree references past the end of the heap, which happened to be
past the end of PSRAM on the esp32-s2.

The fix in this commit is to ensure there is a one-byte gap after the ATB
filled permanently with AT_FREE.

Fixes issue micropython#7116.

See also adafruit#5021

Signed-off-by: Jeff Epler <[email protected]>
Signed-off-by: Damien George <[email protected]>
jcernato pushed a commit to jcernato/micropython that referenced this pull request Feb 10, 2023
Prior to this fix the follow crash occurred.  With a GC layout of:

    GC layout:
      alloc table at 0x3fd80428, length 32001 bytes, 128004 blocks
      finaliser table at 0x3fd88129, length 16001 bytes, 128008 blocks
      pool at 0x3fd8bfc0, length 2048064 bytes, 128004 blocks

Block 128003 is an AT_HEAD and eventually is passed to gc_mark_subtree.
This causes gc_mark_subtree to call ATB_GET_KIND(128004).  When block 1 is
created with a finaliser, the first byte of the finaliser table becomes
0x2, but ATB_GET_KIND(128004) reads these bits as AT_TAIL, and then
gc_mark_subtree references past the end of the heap, which happened to be
past the end of PSRAM on the esp32-s2.

The fix in this commit is to ensure there is a one-byte gap after the ATB
filled permanently with AT_FREE.

Fixes issue micropython#7116.

See also adafruit#5021

Signed-off-by: Jeff Epler <[email protected]>
Signed-off-by: Damien George <[email protected]>
karfas pushed a commit to karfas/micropython that referenced this pull request Apr 23, 2023
Prior to this fix the follow crash occurred.  With a GC layout of:

    GC layout:
      alloc table at 0x3fd80428, length 32001 bytes, 128004 blocks
      finaliser table at 0x3fd88129, length 16001 bytes, 128008 blocks
      pool at 0x3fd8bfc0, length 2048064 bytes, 128004 blocks

Block 128003 is an AT_HEAD and eventually is passed to gc_mark_subtree.
This causes gc_mark_subtree to call ATB_GET_KIND(128004).  When block 1 is
created with a finaliser, the first byte of the finaliser table becomes
0x2, but ATB_GET_KIND(128004) reads these bits as AT_TAIL, and then
gc_mark_subtree references past the end of the heap, which happened to be
past the end of PSRAM on the esp32-s2.

The fix in this commit is to ensure there is a one-byte gap after the ATB
filled permanently with AT_FREE.

Fixes issue micropython#7116.

See also adafruit#5021

Signed-off-by: Jeff Epler <[email protected]>
Signed-off-by: Damien George <[email protected]>
alphonse82 pushed a commit to alphonse82/micropython-wch-ch32v307 that referenced this pull request May 8, 2023
Prior to this fix the follow crash occurred.  With a GC layout of:

    GC layout:
      alloc table at 0x3fd80428, length 32001 bytes, 128004 blocks
      finaliser table at 0x3fd88129, length 16001 bytes, 128008 blocks
      pool at 0x3fd8bfc0, length 2048064 bytes, 128004 blocks

Block 128003 is an AT_HEAD and eventually is passed to gc_mark_subtree.
This causes gc_mark_subtree to call ATB_GET_KIND(128004).  When block 1 is
created with a finaliser, the first byte of the finaliser table becomes
0x2, but ATB_GET_KIND(128004) reads these bits as AT_TAIL, and then
gc_mark_subtree references past the end of the heap, which happened to be
past the end of PSRAM on the esp32-s2.

The fix in this commit is to ensure there is a one-byte gap after the ATB
filled permanently with AT_FREE.

Fixes issue micropython#7116.

See also adafruit#5021

Signed-off-by: Jeff Epler <[email protected]>
Signed-off-by: Damien George <[email protected]>
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.

1 participant