Posts

gdb basics

Image
Step 1: Create debug enabled binary. Use -g flag for that while compiling Eg:  cc test.c -g -o test.bin step 2 : Run gdb  Use -tui option to enable text user interface too see the code whike running gdb Need to pass the binary and c file as argument  COMMAND: gdb -tui test.bin test.c Step 3: use the following commands to debug break <function name> to set break point  Eg: break main <-----------This sets breakpoint at main. run This command will execute the entire program if there is no break point present.  If break point is present it will halt the execution there. print <Variable   name>  To print the variable value. n n command executes the next instruction s s command steps to next instruction ( if the next line is a function , s  command will execute the first line in the function,but n command will execute all the codes in the function and return) q q command stops the gdb and exit.

STM32 F303RE SPI using HAL - API explanation - interfacing MAX7219 - 8*8 led matrix driver

Image
 Step 1: Create project in STM32 cube MX Enable SPI 1 Configure SPI 1 as follows    Max7219 timing diagram and data format Max 7219 register address details: a a Step 2: Code implementation  Declare SPI_HandleTypeDef object for SPI 1 as shown below SPI_HandleTypeDef hspi1;  Use  HAL_SPI_Transmit( ) to send data to MAX7219         HAL_SPI_Transmit( ) arguments     param 1:  hspi pointer to a SPI_HandleTypeDef structure that contains                  the configuration information for SPI module.   param  2: pData pointer to data buffer   param  3: Size amount of data to be sent   param  4: Timeout Timeout duration