Skip to main content

CRC calculation in STM32F407VET6

 In STM32F407VET6 board we can calculate CRC-32/MPEG-2 using following steps:

1. Enable CRC engine at Pinout & Configuration> Computing> CRC mode and Configuration should be activated

2. Save project and generate the project

3. Define data buffer on which we wants to calculate CRC

uint32_t crcArray[4] = {0x00001111, 0x00002222, 0x00003333, 0x00004444};

4. Function call for crc needs to be called in main function as:

crcVal = HAL_CRC_Calculate(&hcrc, crcArray, 4);

Where, uint32 of CRC will be returned.

5. After running the code we will get CRC as shown below:


6. Verify CRC using Online calculator 



CRC value calculated on STM32 and online calculator are matching.

Comments

Popular posts from this blog

Hello World on Ubantu Docker Image

 Steps to run simple C program on Ubantu Docker image: 1. Following files needs to be created in Working Directory folder.    hello.c    Dockerfile 2. hello.c file contains c program with  Hello, World! message printed out. 3. Dockerfile should contain below code          FROM ubuntu:latest            RUN apt-get update && apt-get install -y gcc            COPY hello.c /app/hello.c            WORKDIR /app            RUN gcc -o hello hello.c            CMD ["./hello"] 4. Build docker image using command " docker build -t my-hello-app ." 5. Once docker image is built, run the docker container using command "docker run my-hello-app" 6. Hello, World! will be printed out.

Connecting VSC with Raspberry Pi via SSH

 Steps to connect VSC to Raspberry Pi Running on Linux with SSH. 1. Follow steps mentioned in Putty blog to Enable SSH on Raspberry Pi. 2. Enable Extension " Remote - SSH" in VSC. 3. Go to view>Command Palette>Remote-SSH: Add new SSH host. 4. Enter ssh <username>@<Ip address> 5. Select config file with your user name. This will start setting up SSH Host. 6. It will prompt to enter password for your Raspberry Pi device. 7. After entering valid password SSH is established. 8. Now you can open folder from Raspberry Pi device. Which is your working Directory. 

Run GCC Docker image on Raspberry pi

 Steps to Run GCC Docker image on Raspberry pi: 1. Create folder with below contents:      build --> Folder      Dockerfile --> Docker image file      main.c  --> C Program 2. Write a simple c program into main.c file      // C program to implement      // the above approach      #include <stdio.h>      // Driver code      int main()      {          printf("Welcome to Docker World!!!\n");          return 0;      } 3. Edit Dockerfile and write below contents      FROM gcc:latest      COPY . /build      WORKDIR /build/      RUN gcc -o main main.c      CMD [“./main”] 4. Save and Build Dockerfile, using command "docker build -t main-gcc-app ."      DEPRECATED: The legacy build...