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

Question: Debugging in STM32CubeIDE #606

Open
2nOrderEDO opened this issue Jan 1, 2024 · 0 comments
Open

Question: Debugging in STM32CubeIDE #606

2nOrderEDO opened this issue Jan 1, 2024 · 0 comments

Comments

@2nOrderEDO
Copy link

2nOrderEDO commented Jan 1, 2024

I created a very simple ON-OFF statemachine that transitions when a button in my development board is pressed.

#include "cpp_main.h"
#include "main.h"
#include "sml.h"

namespace sml = boost::sml;

struct user_button {};

constexpr auto toggle = []{HAL_GPIO_TogglePin(LED_GREEN_GPIO_Port, LED_GREEN_Pin);};

struct blink_hsm {
  auto operator()() const {
    using namespace sml;

    return make_transition_table(
      *"off"_s  + event<user_button> / toggle = "on"_s,
       "on"_s   + event<user_button> / toggle = "off"_s
    );
  }
};

void cpp_main(){

  using namespace sml;

  sm<blink_hsm> sm{};

	while(1){

	  if(HAL_GPIO_ReadPin(B1_GPIO_Port, B1_Pin)){
	    sm.process_event(user_button{});
	  }
	}
}

In general, I understand the advantages SML provides and programming microcontrollers in C++ seems like a cool idea to me, although I'm a newbie in C++, and therefore need some guidance.

The first problem I face is that when running the debugger in STM32CubeIDE, it seems impossible to get any debug information about the statemachine (see right column in image below):

image

Is there a way to improve debug information of SML?

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

No branches or pull requests

1 participant