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

Adds STM32G0B1 port. #810

Merged
merged 40 commits into from
Jan 18, 2025
Merged

Adds STM32G0B1 port. #810

merged 40 commits into from
Jan 18, 2025

Conversation

balazsracz
Copy link
Collaborator

@balazsracz balazsracz commented Jan 18, 2025

Part of this work is by Brian Barnt.

CAN does not work yet, but serial does.

  • Adds a g0b1 generic board directory, with startup and find-emulator
  • Adds a g0b1re-nucleo and a g0b1rc-railcom board directories with appropriate HwInit files.
  • Adds example application for blink_raw and io_board.

Note that the Nucleo port uses the internal RC oscillator which does not have appropriate accuracy for us.

Misc fixes:

  • Fixes the default_handlers.h to be usable on both armv7m and armv6m cores. Fixes some assmebler syntax issues there. Links it to armv6m.
  • Fixes possible overrun in the bss and data segment initialization, when the segment length is not divisible by 4.

Remaining work:

  • The Stm32Uart driver needs cleanup of the conditional compilation flags. I'm not sure that the interrupts are correct for example.
  • A new module for MCAN needs to be developed.

Brian J Barnt and others added 30 commits August 26, 2023 19:41
* master: (76 commits)
  Fixes some compile errors in nucleo and bracz.acc.
  ESP-IDF CMakeLists (#800)
  BLE Basic Infrastructure (#788)
  Handles unhandled-addressed-messages by generating an OIR reply. (#798)
  Adds factory reset handler to linux:io_board. (#797)
  Fixes a standards compliance issue with the alias conflict handler. (#793)
  Bug fixes in DataBuffer (#791)
  Fixes race conditions in HubDeviceSelect. (#795)
  Fixes missing translation of enums when reading the security mode from a simplelink profile. (#796)
  Fixes flaky IfCanStress.test. (#794)
  Pin esp32 platform to 2.0.x (#792)
  Fixes detecting EOF in the memory config protocol handler. (#789)
  Adds a new hub application using DirectHub (#761)
  High-performance hub component for dealing with many sockets and high throughput (#760)
  Fix build of esp8266 train implementation.
  Removes unnecessary includes that might not exist on an embedded compiler.
  Fix compilation of TempFile under esp8266.
  Add libatomic to esp8266 nonos target.
  Fix compile errors in time_client app.
  Fixes in file memory space: (#786)
  ...
Updates the list of HAL files from the G0 STM32Cube version 1.16.2
- fixes initialization bugs when the size of bss or data is not divisible by 4
- fixes incorrect assembler syntax
- makes the assembler code use only instruction present in Cortex-M0.

Links the default_handlers.h to armv6m directory as well.
Updates STM32G0B1 startup.c to use default_handlers.
@balazsracz balazsracz marked this pull request as ready for review January 18, 2025 16:48
@balazsracz balazsracz requested a review from bakerstu January 18, 2025 16:49
@@ -0,0 +1,148 @@
/** \copyright
* Copyright (c) 2013, Balazs Racz
Copy link
Owner

Choose a reason for hiding this comment

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

Should the copyright year here and below be updated?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed

@@ -0,0 +1,79 @@
#ifndef _APPLICATIONS_IO_BOARD_TARGET_CONFIG_HXX_
Copy link
Owner

Choose a reason for hiding this comment

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

There is no block header at the top of this file for copyright, file doxygen, etc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added

@@ -0,0 +1,79 @@
#ifndef _APPLICATIONS_IO_BOARD_TARGET_CONFIG_HXX_
Copy link
Owner

Choose a reason for hiding this comment

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

...also no file block header 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.

added

@@ -0,0 +1,148 @@
/** \copyright
* Copyright (c) 2013, Balazs Racz
Copy link
Owner

Choose a reason for hiding this comment

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

Should the dates be updated?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think so, since this file was forked without any modification.

"has_bit_two: \n"
" mrs r0, psp \n"
"test_done: \n"
#else // original code
Copy link
Owner

Choose a reason for hiding this comment

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

Do we want to remove this dead code, or is it intentionally left behind?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed

void timer17_fdcan_it1_interrupt_handler(void)
{
blinker_interrupt_handler();
// todo: Fix fdcan Instances...
Copy link
Owner

Choose a reason for hiding this comment

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

Minor annoyance, the commented out code is spaced kind of weird. Also, the todo tag is not a doxygen tag.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I will update this after I make the MCAN port.

@@ -0,0 +1,13 @@

Copy link
Owner

Choose a reason for hiding this comment

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

Missing file block header.

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

@@ -0,0 +1,204 @@
/** \copyright
* Copyright (c) 2015, Stuart W Baker
Copy link
Owner

Choose a reason for hiding this comment

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

Should we update the dates?

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

*/

#ifndef STM32G0B1xx
#pragma message "Compiling CAN Driver"
Copy link
Owner

Choose a reason for hiding this comment

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

Is this necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed


#endif // ARDUINO_ARCH_STM32
#endif // !STM32G0B1
#pragma message "CAN Driver Complete"
Copy link
Owner

Choose a reason for hiding this comment

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

Is this necessary?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed

@balazsracz balazsracz merged commit 9829633 into master Jan 18, 2025
4 checks passed
@balazsracz balazsracz deleted the bjb-stm32g0b1 branch January 18, 2025 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants