FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    Steps to implement CAN communication on the STM32H743 chip

     

    Abstract This note mainly introduces that CAN communication is implemented on the STM32H743 chip, and the BSP driver is encapsulated, and the foundation for high-level communication of CAN will be implemented. 2. Prepare 1, IAR 8.32.1 2, STM32Cube_fw_h7_v1.6.0 3. Introduction The STM32H743 controller Local Area Network (CAN) subsystem consists of two CAN modules, a shared message RAM memory, and a clock calibration unit. For the base address of these four components, see Memory Mapping. Both CAN modules (FDCAN1 and FDCAN2) are in line with ISO 11898-1: 2015 (CAN Agreement Specification No. 2.0) and CAN FD Protocol Specifications No. 1.0. In addition, the first CAN module FDCAN1 supports the time triggered in ISO 11898-4, including event synchronous time trigger communication, global system time, and clock drift compensation. FDCAN1 also includes a register used for time triggering functions. The CAN FD option can be used with event triggering and time triggering CAN communication. 10 kb Message RAM memory enables filters, receive FIFO, receive buffers, sends event FIFO, and send buffers (TTCAN trigger) functions. This message RAM is shared between FDCAN1 and FDCAN2 modules. The generic clock calibration unit is optional. By evaluating the CAN message received by FDCAN1, the unit can generate a calibrated clock based on the HSI internal RC oscillator and PLL to FDCAN1 and FDCAN2. CAN block diagram Most of the bottom layer of CAN is in the HAL library. If you look at the HAL source code, you understand this picture, the H743's Can You basically has no problem, in combination with the HAL library. 4. Drive implementation Good driving package can be easily applied, and can be easily ported to other projects, and the code reuse is high, so the data and interfaces are the problems you have to consider, how easy to implement, but also use. 4.1 Data Package First, according to STM32H7XX_HAL_FDCAN.H files, we will package two structures, so that the rear software is developed, you can create BSP_can.c and bsp_can.h, encapsulate structural definitions in the header file. Define some variables in .C files, these variable arrays are also universal, and they can be used in a variety of products. Multiple CAN ports can be implemented. If there is only one CAN port, the CAN_PORTS macro is defined as 1, and several will be defined as a few. You can remember this package, I am in a variety of devices, before the NXP's Ke06, KEA, KV46, K64 and other series, this packaging is used in ST's F103, F446, H743 and other CAN communications. BSP driver. 4.2 Initialization Refer to the official routine, according to your hardware, do the corresponding modification. In the routine, it is only possible to receive an interrupt. We generally send it to the interrupt, so it is also necessary to develop the interrupt, which may also need to add filter, configure buffer, etc. according to the actual possibilities. Configure the clock tube foot, interrupt. 4.3 Interrupt Tune Function The most important thing is to receive and send the power of the callback function, first to see the reception interrupt callback function. Send completed callback function 4.4 Test Code Establish a simple test task of a CAN communication under Freertos, and achieve what is sent out. To call this test function in the 10ms of the task, implement the transceiver test. The test can be written, officially we need to parse the received content, and reorganize the sended frames, these resolution and reorganizations will implement in the high-level protocol driver, with this driver to implement CANopen, J1939, DeviceNet and other CAN high-level agreements. 5. Test Test, extended frame, 500k bit rate, transmitted data AA, 01, 02, 03, 04, 05, 06, BB. After receiving the data sent by the computer, the board is sent back to the computer. Send 100,000 times, 10ms once. Use a USB-CAN to connect to your computer. At this time, our CAN communication BSP driver package is verified, it can be easily ported to other boards. Pay attention to me, bring you more exciting content, read full text, original title: CAN communication BSP package Article Source: [Micro Signal: GCCANZX, WeChat public number: APP interface development] Welcome to add attention! Please indicate the source of the article.

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us