2022-01-10 09:14 AM
I studying a Modbus RTU 'Slave' and in my opinion I did everything right according to this library https://github.com/alejoseb/Modbus-STM32-HAL-FreeRTOS
I want to check, do I right Implemented a code by controlling a built-in LED.
But there is no knowledge how to check it out! Only guesses and no more!
Do I need to create a variable that will be 'tied' to a register which turns on/off the LED and find out variable's address?!?
Something like this for example:
valotile uint8_t p = HAL_GPIO_ReadPin(LED_GPIO_Port, LED_pin);
printf("Adress of variable 'p' is: %p\r\n", &p); // 0x20004ff7
And then we know the address of the variable to write it into the simulator of Modbus master.
Is it correct?