We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Good moorning,
I am trying to use LwIP to do a RAW Socket TCP connection. I have did it without problems but i used the compiler 5, i want add this development to another proyect that i am doing but in that i use the compiler 6. When i try to migrate it, appears too many compile errors.
Do you know if there are any limitations? Someone use LwIP with the compiler 6?
I am working with a ST microcontoller, the STM32F779NI. The IDE that use is the KEIL MDK.
I hope you can help me. Thank you very much for you time.
So you have a working version, and a non-working version.
You need to narrow down where the non-working version is failing - it's no use just saying, "it doesn't work".
Use the debugger to step through the code - is it getting stuck somewhere?
Are you getting error returns?
Instrument both the working & non-working versions, and look where they differ - then focus your debugging at those points ...
I found the error, but i dont know the exactly sintaxis to fix it.
#if defined ( __CC_ARM ) ETH_DMADescTypeDef DMARxDscrTab[ETH_RXBUFNB] __attribute__((at(0x2007C000)));/* Ethernet Rx DMA Descriptors */ ETH_DMADescTypeDef DMATxDscrTab[ETH_TXBUFNB] __attribute__((at(0x2007C080)));/* Ethernet Tx DMA Descriptors */ uint8_t Rx_Buff[ETH_RXBUFNB][ETH_RX_BUF_SIZE] __attribute__((at(0x2007C100))); /* Ethernet Receive Buffers */ uint8_t Tx_Buff[ETH_TXBUFNB][ETH_TX_BUF_SIZE] __attribute__((at(0x2007D8D0))); /* Ethernet Transmit Buffers */ #elif defined ( __ICCARM__ ) /*!< IAR Compiler */ #pragma data_alignment=4 #pragma location=0x2007C000 __no_init ETH_DMADescTypeDef DMARxDscrTab[ETH_RXBUFNB];/* Ethernet Rx DMA Descriptors */ #pragma location=0x2007C080 __no_init ETH_DMADescTypeDef DMATxDscrTab[ETH_TXBUFNB];/* Ethernet Tx DMA Descriptors */ #pragma location=0x2007C100 __no_init uint8_t Rx_Buff[ETH_RXBUFNB][ETH_RX_BUF_SIZE]; /* Ethernet Receive Buffers */ #pragma location=0x2007D8D0 __no_init uint8_t Tx_Buff[ETH_TXBUFNB][ETH_TX_BUF_SIZE]; /* Ethernet Transmit Buffers */ #elif defined ( __GNUC__ ) /*!< GNU Compiler */ ETH_DMADescTypeDef DMARxDscrTab[ETH_RXBUFNB] __attribute__((section(".RxDecripSection")));/* Ethernet Rx DMA Descriptors */ ETH_DMADescTypeDef DMATxDscrTab[ETH_TXBUFNB] __attribute__((section(".TxDescripSection")));/* Ethernet Tx DMA Descriptors */ uint8_t Rx_Buff[ETH_RXBUFNB][ETH_RX_BUF_SIZE] __attribute__((section(".RxarraySection"))); /* Ethernet Receive Buffers */ uint8_t Tx_Buff[ETH_TXBUFNB][ETH_TX_BUF_SIZE] __attribute__((section(".TxarraySection"))); /* Ethernet Transmit Buffers */ #endif
In this code fragment the buffers and the DMA descriptors are established, without them I can neither receive nor send packets. The code compiled and gave no errors because for compiler 6, there is no option and all were disabled.
In order to make this part work I have to migrate it to compiler 6, according to the migration manual I should use this syntax:
__attribute__((section(".ARM.__at_address"))) //armlink in Arm Compiler 6 still supports the placement of sections in the form of .ARM.__at_address
But when i have tried to migrate the code, i get thesses errors of syntax:
1.- First Try
ETH_DMADescTypeDef DMARxDscrTab[ETH_RXBUFNB] __atribute__((section(".ARM.__at_0x2007C000"))); /* Ethernet Rx DMA Descriptors */
ethernetif.c(80): error: expected ';' after top level declarator ETH_DMADescTypeDef DMARxDscrTab[ETH_RXBUFNB] __atribute__((section(".ARM.__at_0x2007C000"))); /* Ethernet Rx DMA Descriptors */
2.-Second Try
ETH_DMADescTypeDef DMARxDscrTab[ETH_RXBUFNB]; DMARxDscrTab[ETH_RXBUFNB] __atribute__((section(".ARM.__at_0x2007C000"))); /* Ethernet Rx DMA Descriptors */
ethernetif.c(81): warning: type specifier missing, defaults to 'int' [-Wimplicit-int] DMARxDscrTab[ETH_RXBUFNB] __atribute__((section(".ARM.__at_0x2007C000"))); /* Ethernet Rx DMA Descriptors */ ^ ethernetif.c(81): error: redefinition of 'DMARxDscrTab' with a different type: 'int [4]' vs 'ETH_DMADescTypeDef [4]' ethernetif.c(80): note: previous definition is here ETH_DMADescTypeDef DMARxDscrTab[ETH_RXBUFNB]; ^ ethernetif.c(81): error: expected ';' after top level declarator DMARxDscrTab[ETH_RXBUFNB] __atribute__((section(".ARM.__at_0x2007C000"))); /* Ethernet Rx DMA Descriptors */
Good Moorning,
I finaly resolved it.
First i found the correct sintaxys for DMA reserve.
// Ethernet Rx DMA Descriptors __attribute__((section(".ARM.__at_0x2007C000"))) \ ETH_DMADescTypeDef DMARxDscrTab[ETH_RXBUFNB]; // Ethernet Rx DMA Descriptors __attribute__((section(".ARM.__at_0x2007c080"))) \ ETH_DMADescTypeDef DMATxDscrTab[ETH_TXBUFNB]; // Ethernet Rx DMA Descriptors __attribute__((section(".ARM.__at_0x2007C100"))) \ uint8_t Rx_Buff[ETH_RXBUFNB][ETH_RX_BUF_SIZE]; // Ethernet Rx DMA Descriptors __attribute__((section(".ARM.__at_0x2007D8D0"))) \ uint8_t Tx_Buff[ETH_TXBUFNB][ETH_TX_BUF_SIZE];
Second i changed the memory map in sct file. I changed the size of IRAM1, for have a space reserved.
RW_IRAM1 ADDRESS SIZE{ ;RW data .ANY(+RW +ZI) } ; ************************************************************* ; *** Scatter-Loading Description File generated by uVision *** ; ************************************************************* LR_IROM1 0x08000000 0x00200000 { ; load region size_region ER_IROM1 0x08000000 0x00200000 { ; load address = execution address *.o (RESET, +First) *(InRoot$$Sections) .ANY (+RO) .ANY (+XO) } RW_IRAM1 0x20020000 0x0005C000 { ; RW data .ANY (+RW +ZI) } RW_IRAM2 0x20000000 0x00020000 { .ANY (+RW +ZI) } }
Thank you very much for you time and help.
Kinds Regards