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

2022q2 release #875

Merged
merged 18 commits into from Jul 12, 2022
Merged

2022q2 release #875

merged 18 commits into from Jul 12, 2022

Conversation

chris-durand
Copy link
Member

@chris-durand chris-durand commented Jun 27, 2022

It's quarterly release time again! 2022-07-01 is the date.

  • Update all submodules
  • Fix submodule issues
    • CMSIS DSP 5.9.0
    • ETL 20.29.3
    • AVR libstdc++ issue with Mac OS avr-gcc 10.3
  • Merge remaining PRs?
  • Update toolchains to gcc 11 Postponed to after release
  • Rebuild docker images and use new images
  • Update release notes
  • Hardware testing
    • Hosted Linux ✅
    • Hosted Windows ✅ (CI)
    • Hosted MacOS/Darwin ✅ (CI)
    • Nucleo-F091RC ✅ (New: Split in two parts)
    • Nucleo-F103RB ✅
    • Nucleo-F401RE ✅
    • Nucleo-F411RE ✅
    • New: Nucleo-F429ZI ✅
    • Nucleo-F446RE ✅
    • Nucleo-F446ZE (@rleh has no hardware)
    • New: Nucleo-F767ZI ✅
    • Nucleo-G474RE ❌ (Failed 8 of 4985 tests; gpio sampler...)
    • New: Nucleo-H723ZG ✅
    • Nucleo-L432KC ✅
    • New: Nucleo-L496ZG-P ✅
    • Nucleo-L552ZE-Q ✅
  • Fix Rcc::disable<...>() always disabling unrelated clocks due to missing curly braces on a multi-line if block.
  • Fix mismatched operator delete[] in SPI mock
  • Fix STM32 unit tests in debug build
  • Fix STM32F7 linker script bug that placed .data and .stack section at the same address.
  • Fix GpioSampler driver and test
  • Fix STM32F7 missig DMA bit for DTCM RAM

The fix from modm-io/avr-libstdcpp#20 seems to be required for the Mac OS 10.3 avr-gcc version. I have added an additional commit to it on a branch to also apply it for versions starting from gcc 10.3. Hardware testing is required that it does not break avr-gcc 11.1-11.2.

@rleh rleh added this to the 2022q2 milestone Jul 1, 2022
docs/release/2022q2.md Outdated Show resolved Hide resolved
Copy link
Member

@salkinium salkinium left a comment

Choose a reason for hiding this comment

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

Thanks!

docs/release/2022q2.md Show resolved Hide resolved
docs/release/2022q2.md Outdated Show resolved Hide resolved
docs/release/2022q2.md Outdated Show resolved Hide resolved
docs/release/2022q2.md Show resolved Hide resolved
docs/release/2022q2.md Outdated Show resolved Hide resolved
docs/release/2022q2.md Outdated Show resolved Hide resolved
@rleh rleh marked this pull request as ready for review July 10, 2022 17:08
@rleh rleh requested review from salkinium and rleh July 10, 2022 17:08
@rleh
Copy link
Member

rleh commented Jul 10, 2022

I'm not going to fix the gpio sampler issues for this release.
Gpio sampler issue: #878

@chris-durand
Copy link
Member Author

I have added a fix for missing curly braces in Rcc::disable<...>(). Generated code:

 if constexpr (peripheral == Peripheral::Eth)
                RCC->AHB1ENR &= ~RCC_AHB1ENR_ETHMACEN; __DSB();
                RCC->AHB1ENR &= ~RCC_AHB1ENR_ETHMACRXEN; __DSB();
                RCC->AHB1ENR &= ~RCC_AHB1ENR_ETHMACTXEN;

The last two lines will always be executed regardless of which clock the user is trying to disable.

@rleh
Copy link
Member

rleh commented Jul 10, 2022

I catched the Nucleo-F767 unit test with GDB in the undefined handler:

(gdb) i s
#0  modm::delay_us (us=<optimized out>) at modm/src/modm/platform/core/delay.cpp:32
#1  0x0020339a in modm::delay_ms (ms=<optimized out>, ms@entry=20) at modm/src/modm/platform/core/delay_impl.hpp:53
#2  0x0020341c in modm_abandon (info=...) at modm/src/modm/board/board.cpp:39
#3  0x002052a8 in modm_assert_report (cinfo=cinfo@entry=0x20000a6c) at modm/src/modm/platform/core/assert.cpp:42
#4  0x0020557e in Undefined_Handler () at modm/src/modm/platform/core/vectors.c:293
#5  <signal handler called>
#6  0x00235a12 in _free_r ()
#7  0x0020332a in operator delete (ptr=<optimized out>) at modm/ext/gcc/new_delete.cpp:87
#8  0x0022c4b0 in modm_test::SpiDevice::start (this=this@entry=0x20000a98, transmissions=transmissions@entry=0x20000b40, transmissionCount=transmissionCount@entry=4, lineNumber=lineNumber@entry=113, reportErrors=reportErrors@entry=true) at modm-test/src/modm-test/mock/spi_device.cpp:159
#9  0x00216136 in Ad7280aTest::testChainSetup (this=this@entry=0x20000b5c) at modm-test/src/modm-test/driver/adc/ad7280a_test.cpp:113
#10 0x00200ca4 in unittest::Controller::run (reporter=...) at unittest_runner.cpp:189
#11 0x002062c6 in main () at main.cpp:69

Any idea @chris-durand what might cause this fault on STM32F7?

@rleh
Copy link
Member

rleh commented Jul 10, 2022

Might be memory-related. If I only include some tests (e.g. everything except modm-test:test:driver and modm-test:test:math) in the binary the tests run successfully.

@chris-durand
Copy link
Member Author

Any idea @chris-durand what might cause this fault on STM32F7?

operator delete is crashing… You could try to do a minimal example with dynamic allocation to see if heap allocation / deallocation generally works?

@chris-durand
Copy link
Member Author

That mock SPI device does dynamic allocation. We could have some bug there.

@chris-durand
Copy link
Member Author

The reason is memory corruption in the SPI mock. If you ran the hosted unit test binary in valgrind, you get that:

>>> spi_device_test
==30931== Mismatched free() / delete / delete []
==30931==    at 0x483D1CF: operator delete(void*, unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==30931==    by 0x1549F6: modm_test::SpiDevice::start(modm_test::Transmission const*, unsigned long, unsigned long, bool) (spi_device.cpp:159)
==30931==    by 0x131449: SpiDeviceTest::testSingleTransmission() (spi_device_test.cpp:69)
==30931==    by 0x113DB9: unittest::Controller::run(unittest::Reporter) (unittest_runner.cpp:1476)
==30931==    by 0x10FA34: main (main.cpp:75)
==30931==  Address 0x4df8e00 is 0 bytes inside a block of size 4 alloc'd
==30931==    at 0x483C583: operator new[](unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==30931==    by 0x154A0B: modm_test::SpiDevice::start(modm_test::Transmission const*, unsigned long, unsigned long, bool) (spi_device.cpp:164)
==30931==    by 0x131337: SpiDeviceTest::testSingleTransmission() (spi_device_test.cpp:50)
==30931==    by 0x113DB9: unittest::Controller::run(unittest::Reporter) (unittest_runner.cpp:1476)
==30931==    by 0x10FA34: main (main.cpp:75)
==30931== 
==30931== Mismatched free() / delete / delete []
==30931==    at 0x483D1CF: operator delete(void*, unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==30931==    by 0x13152D: SpiDeviceTest::testSingleTransmission() (spi_device_test.cpp:49)
==30931==    by 0x113DB9: unittest::Controller::run(unittest::Reporter) (unittest_runner.cpp:1476)
==30931==    by 0x10FA34: main (main.cpp:75)
==30931==  Address 0x4df8e50 is 0 bytes inside a block of size 4 alloc'd
==30931==    at 0x483C583: operator new[](unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==30931==    by 0x154A0B: modm_test::SpiDevice::start(modm_test::Transmission const*, unsigned long, unsigned long, bool) (spi_device.cpp:164)
==30931==    by 0x131449: SpiDeviceTest::testSingleTransmission() (spi_device_test.cpp:69)
==30931==    by 0x113DB9: unittest::Controller::run(unittest::Reporter) (unittest_runner.cpp:1476)
==30931==    by 0x10FA34: main (main.cpp:75)
==30931== 
==30931== Mismatched free() / delete / delete []
==30931==    at 0x483D1CF: operator delete(void*, unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==30931==    by 0x131741: SpiDeviceTest::testMultipleTransmissions() (spi_device_test.cpp:95)
==30931==    by 0x113DD1: unittest::Controller::run(unittest::Reporter) (unittest_runner.cpp:1479)
==30931==    by 0x10FA34: main (main.cpp:75)
==30931==  Address 0x4df8ea0 is 0 bytes inside a block of size 4 alloc'd
==30931==    at 0x483C583: operator new[](unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==30931==    by 0x154A0B: modm_test::SpiDevice::start(modm_test::Transmission const*, unsigned long, unsigned long, bool) (spi_device.cpp:164)
==30931==    by 0x13160F: SpiDeviceTest::testMultipleTransmissions() (spi_device_test.cpp:96)
==30931==    by 0x113DD1: unittest::Controller::run(unittest::Reporter) (unittest_runner.cpp:1479)
==30931==    by 0x10FA34: main (main.cpp:75)
==30931== 

The bug is most likely in the mock, not the driver code.

@rleh

This comment was marked as outdated.

@chris-durand
Copy link
Member Author

One bug in the mock is fixed. operator new[] is used together with operator delete instead of operator delete[]. When I have time I'll replace that whole construct with a std::vector.

@chris-durand
Copy link
Member Author

We really need to build and run hosted unit tests with address sanitizer, thread sanitizer and UB sanitizer. I'll put that onto my todo list.

@rleh rleh added ci:hal Triggers the exhaustive HAL compile CI jobs documentation 📑 process 📊 and removed ci:hal Triggers the exhaustive HAL compile CI jobs labels Jul 11, 2022
@chris-durand chris-durand added the ci:hal Triggers the exhaustive HAL compile CI jobs label Jul 11, 2022
@chris-durand chris-durand added ci:hal Triggers the exhaustive HAL compile CI jobs and removed ci:hal Triggers the exhaustive HAL compile CI jobs labels Jul 11, 2022
@salkinium
Copy link
Member

If I understand correctly, this release is ready to be merged, right?

@rleh
Copy link
Member

rleh commented Jul 12, 2022

Yes. Go!

@salkinium salkinium added ci:hal Triggers the exhaustive HAL compile CI jobs and removed ci:hal Triggers the exhaustive HAL compile CI jobs labels Jul 12, 2022
@salkinium
Copy link
Member

Just checking, cos my brain has teh dumbz today

@salkinium salkinium merged commit 7cae883 into modm-io:develop Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:hal Triggers the exhaustive HAL compile CI jobs documentation 📑 process 📊
Development

Successfully merging this pull request may close these issues.

Unit tests fail with profile=debug Memory traits wrong for STM32F7 DTCM GpioSampler broken
3 participants