FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    Introduction to RT-THREAD, STM32H7, LWIP

     

    "I. write in front Stm32h7 is still a relatively new MCU at present. Compared with F1 F4 series, there are relatively few online data. I took many detours and got a lot of help when transplanting this LwIP. Writing this article is also a summary of my own transplantation, and I hope that later people can avoid detours. This article is edited and organized by individuals. If there are any mistakes, please clap bricks. 2、 Introduction to RT thread, stm32h7 and LwIP RT thread is an open source Internet of things operating system from China. It provides very strong scalability: from a very small kernel that can run on arm Cortex-M0 chip to a medium arm Cortex-M3 / 4 / 7 system, and even a function rich system running on mips32 and arm cortex-a series processors. Stm32h7 is St stm32h7_ M series highest performance processor. The main frequency is up to 400m, flash is up to 2mbytes and SRAM is up to 1mbytes. It adopts six-stage pipeline, with its own instruction and data cache, integrated JPEG codec, codec, integrated double precision hardware floating-point computing unit (dpfpu) and DSP instructions. LwIP is a small open source TCP / IP protocol stack developed by Adam dunkels of the Swedish Academy of Computer Sciences (sics). 3、 Particularity of stm32h7 The particularity here is only compared with F1 F4 series: 1. Ramf1 F4 series only has one ram, which can be directly allocated to RTOS as heap when using RTOS. The ram composition of H7 is shown in the following table: The speed of dtcm is 400m, but DMA cannot access it. The speed of Axi SRAM is 200m and DMA can be accessed. Sram3 is a buffer for Ethernet and USB. 2. Cacheh7 has an L1 cache level 1 cache more than F1 F4. This cache not only accelerates the low-speed memory, but also brings some problems to the program, the most important of which is the problem of data consistency. For cache policy issues, please refer to the brief introduction to the cache workflow of M7 kernel and the experience summary of half a year. (please copy the link to an external browser to open it: http://forum.armfly.com/forum.php?mod=viewthread&tid=90066&highlight=%C3%FE%C5%C0%B9%F6%B4%F2 ) 3. The dam of dmah7 is divided into dma1, dam2, BDMA and MDMA. The DMA of SDIO and eth is independent, that is to say, they have dedicated DMA, which does not conflict with other dams without additional enabling. They only need to turn on the interrupt to use the DMA mode by default. 4、 Preparation before transplantation 1. Ensure that there is a project that can run RT thread normally on the development board. At present, RT thread has BSP of punctual atom h743 (address: https://github.com/RT-Thread/rt-thread/tree/master/bsp/stm32/stm32h743-atk-apollo If you like, don't forget to point to RT thread), use the env tool to take out the project by using cons -- dist, and copy the project under the dist folder for direct use; 2. Use env tool to start the software simulation IIC, because the PHY reset of the development board of punctual atom is connected to pin 7 of pcf8574, and then the generation project will report an error. At this time, copy pcf8574. C pcf8574. H PHY from another BSP directory_ Reset. C, put it into the project, and then add the following code in rtconfig. H to enable simulated IIC 1#defineBSP_ USING_ I2C223#defineBSP_ I2C2_ SCL_ PIN1164#defineBSP_ I2C2_ SDA_ PIN117 The pin number here is determined by the hardware. If it is not an atomic development board, this step can be omitted 3. Because stm32bsp in RT thread directory depends on cubemx, you also need to turn on eth pin in cubemx. Please be consistent with your own board; Turn on RMII mode. Note that PC1 pin here cannot be selected as high level. You need to modify it to high level in MSP. C and turn on interrupt. 4. Check if I is turned on_ Cache and D_ CACHE It must be enabled here. There are dependencies in it. Otherwise, the cache will not run correctly. 5. Then generate the project through cubemx and copy the clock initialization part to board. C 6. In DRV_ MPU configuration Ethernet DMA descriptor area is added to MPU. C, which can only be configured as strongly - order or device. 1MPU_ Region_ InitTypeDefMPU_ InitStruct; 2 3/*DisabletheMPU*/ 4HAL_ MPU_ Disable(); 5 6/*ConfiguretheMPUattributesasDevicenotcacheable 7forETHDMAdescriptors*/ 8MPU_ InitStruct.Enable=MPU_ REGION_ ENABLE; 9MPU_ InitStruct.BaseAddress=0x30040000; 10MPU_ InitStruct.Size=MPU_ REGION_ SIZE_ 256B; 11MPU_ InitStruct.AccessPermission=MPU_ REGION_ FULL_ ACCESS; 12MPU_ InitStruct.IsBufferable=MPU_ ACCESS_ BUFFERABLE; 13MPU_ InitStruct.IsCacheable=MPU_ ACCESS_ NOT_ CACHEABLE; 14MPU_ InitStruct.IsShareable=MPU_ ACCESS_ NOT_ SHAREABLE; 15MPU_ InitStruct.Number=MPU_ REGION_ NUMBER0; 16MPU_ InitStruct.TypeExtField=MPU_ TEX_ LEVEL0; 17MPU_ InitStruct.SubRegionDisable=0x00; 18MPU_ InitStruct.DisableExec=MPU_ INSTRUCTION_ ACCESS_ ENABLE; 1920HAL_ MPU_ ConfigRegion(&MPU_ InitStruct); 2122/*ConfiguretheMPUattributesasCacheablewritethrough23forLwIPRAMheapwhichcontainstheTxbuffers*/24MPU_ InitStruct.Enable=MPU_ REGION_ ENABLE; 25MPU_ InitStruct.BaseAddress=0x30044000; 26MPU_ InitStruct.Size=MPU_ REGION_ SIZE_ 16KB; 27MPU_ InitStruct.AccessPermission=MPU_ REGION_ FULL_ ACCESS; 28MPU_ InitStruct.IsBufferable=MPU_ ACCESS_ NOT_ BUFFERABLE; 29MPU_ InitStruct.IsCacheable=MPU_ ACCESS_ CACHEABLE; 30MPU_ InitStruct.IsShareable=MPU_ ACCESS_ NOT_ SHAREABLE; 31MPU_ InitStruct.Number=MPU_ REGION_ NUMBER1; 32MPU_ InitStruct.TypeExtField=MPU_ TEX_ LEVEL0; 33MPU_ InitStruct.SubRegionDisable=0x00; 34MPU_ InitStruct.DisableExec=MPU_ INSTRUCTION_ ACCESS_ ENABLE; 3536HAL_ MPU_ ConfigRegion(&MPU_ InitStruct); 3738/*EnabletheMPU*/39HAL_ MPU_ Enable(MPU_ PRIVILEGED_ DEFAULT); 7. Add eth library function in the project, stm32h7xx_ hal_ Eth. C and stm32h7xx_ hal_ eth_ ex.c 5、 Transplantation of LwIP protocol stack For the migration reference idea, you can also refer to this migration step through git log, but there are several errors in the migration, which will be put forward later. Later, it was found that this migration was similar to stm32cube repository stm32cube_ FW_ H7_ V1.3.2 projectsstm32h743zi nucleoapplicationslwip, basically the same. 1. LwIP protocol stack source code, if you have installed cubemx, then directly from stm32cube repository stm32cube_ FW_ H7_ V1.3.2MiddlewaresThird_ Copy the source code of LwIP under the directory of partylwipp. Or download the link in the reference idea to copy the LwIP source code. 2. Add a new folder LwIP / API in the project: add all files in the lwipsrcapi directory LwIP / core: add files in lwipsrccore directory and include files in IPv4 folder LwIP / netif: add Ethernet. C, sysarch. C LwIP / port: add ethernetif. C, lan8742. C (lan8720 can also be used) All the preparations for transplantation have been completed. In the next section, an error is reported in the modification project!, Read the full text, original title: porting LwIP on stm32h7 based on RT thread (I) The source of the article: [micro signal: RTThread, WeChat official account: the LDA Internet of things] 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