Jump to content

Mamatchai

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by Mamatchai

  1. Hello, As title, I'm currently working on an AMP (Asymmetric Multiprocessing) mode project. In this project, one core (CPU0) processes the data received from ZmodADC1410 and stores it in DDR3, which is a shared resource between the two cores. The other core (CPU1) establishes a TCP connection and acts as both client and server to continuously transmit the data stored in DDR3 to the server. However, I noticed that the sampling rate of our ZmodADC1410 is 40 Mbps,so according to the calculation based on the network speed requirement, it would be 40M*28 (dual-channel) = 1120Mbps, while the fastest network speed is only 160 Mbps. In theory, this should cause either bottlenecking or packet loss, but my senior has implemented a UDP version of the project without encountering such issues. The transmission is continuous and normal. Therefore, I want to examine the internal data transmission status and observe the hardware's cache flow.I wonder if there is any tools or method that I can acheive this.
  2. Recently an expert suggested to me that there might be a conflict occurring during function calls due to the similarity in the names of TCP and ZmodADC interrupt flags(IF). However, I haven't confirmed this yet.
  3. Hello Arthur, After I remove code from the functions in Zmod/baremetal/intc.c,the functionality of initializing ZmodADC has been consistently unusable.I've been trying to solve the issue of initializing the functionality of ZmodADC these past few days.This problem has been bothering me for quite some time.This is quite a strange question, I can't figure it out by myself, I feel like I still need some advice from you.Here's my main.c code. //-------------------------------------------------- // blog.csdn.net/FPGADesigner // copyright by CUIT Qi Liu // Zynq Lwip TCP Communication Test Program //-------------------------------------------------- #include "timer_intr.h" #include "sys_intr.h" #include "user_tcp.h" #include "lwip/netif.h" #include "sleep.h" //#define TRANSFER_LEN 0xB #define TIMER_LOAD_VALUE XPAR_CPU_CORTEXA9_0_CPU_CLK_FREQ_HZ / 8 //0.25S static XScuGic Intc; //GIC static XScuTimer Timer;//timer //extern volatile unsigned tcp_client_connected; //extern int tcp_trans_cnt; void start_application(void); #include "./Zmod/zmod.h" #include "./ZmodADC1410/zmodadc1410.h" #define SEND_SIZE 1463 //extern struct netif server_netif; static char val_formatted[15]; #define TRANSFER_LEN 0x5B7 // ZMOD ADC parameters #define ZMOD_ADC_BASE_ADDR XPAR_AXI_ZMODADC1410_0_S00_AXI_BASEADDR #define DMA_ADC_BASE_ADDR XPAR_AXI_DMA_ADC_BASEADDR #define IIC_BASE_ADDR XPAR_PS7_I2C_1_BASEADDR #define FLASH_ADDR_ADC 0x30 #define ZMOD_ADC_IRQ XPAR_FABRIC_AXI_ZMODADC1410_0_LIRQOUT_INTR #define DMA_ADC_IRQ XPAR_FABRIC_AXI_DMA_ADC_S2MM_INTROUT_INTR //static char sendBuffer_main[TCP_SEND_BUFSIZE]; //-------------------------------------------------- // 中斷與定時器初始化 //-------------------------------------------------- void System_Init() { Timer_init(&Timer,TIMER_LOAD_VALUE,TIMER_DEVICE_ID); Init_Intr_System(&Intc); // initial DMA interrupt system Setup_Intr_Exception(&Intc); Timer_Setup_Intr_System(&Intc,&Timer,TIMER_IRPT_INTR); Timer_start(&Timer); TcpTmrFlag = 0; } //-------------------------------------------------- // 主程序 //-------------------------------------------------- int main(void) { xil_printf("Im here~~~\n"); uint8_t channel=0; uint8_t gain=0; size_t length=TRANSFER_LEN; ZMODADC1410 adcZmod(ZMOD_ADC_BASE_ADDR, DMA_ADC_BASE_ADDR, IIC_BASE_ADDR, FLASH_ADDR_ADC, ZMOD_ADC_IRQ, DMA_ADC_IRQ); uint32_t *acqBuffer; adcZmod.setGain(channel, gain); acqBuffer = adcZmod.allocChannelsBuffer(length); adcZmod.acquireImmediatePolling(acqBuffer, length); static char time_formatted[15]; uint32_t valBuf; int16_t valCh; float val; int coo; xil_printf("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n"); struct netif *netif, server_netif; //用於lwIP網絡接口的通用數據結構 struct ip4_addr ipaddr, netmask, gw; //unsigned int //開發板的MAC地址 unsigned char mac_ethernet_address[] = { 0x00, 0x0a, 0x35, 0x00, 0x01, 0x02 }; System_Init(); netif = &server_netif; //0x50C004 xil_printf("netif = %s\tnetif = 0x%p\t&server_netif = 0x%p\n", netif, netif, &server_netif); //將4byte結構的IP地址轉換爲unsigned int IP4_ADDR(&ipaddr, 192, 168, 1, 10); //IP地址(開發板) IP4_ADDR(&netmask, 255, 255, 255, 0); //網絡掩碼 IP4_ADDR(&gw, 192, 168, 1, 1); //網關 lwip_init(); //初始化lwIP //將網絡接口添加到netif_list中 if (!xemac_add(netif, &ipaddr, &netmask, &gw, mac_ethernet_address, XPAR_XEMACPS_0_BASEADDR)) { xil_printf("Error adding N/W interface\r\n"); return -1; } xil_printf("netif_final = %s\n", netif); //NULL netif_set_default(netif); //設置默認網絡接口 netif_set_up(netif); //啓動網絡接口 tcp_send_init(); //初始化TCP PCB xil_printf("New acquisition ------------------------\r\n"); xil_printf("Ch1\tRaw\tTime\t\r\n"); // while(1) { if(TcpTmrFlag) { tcp_tmr(); TcpTmrFlag = 0; } xemacif_input(netif); //將MAC隊列中的packets傳輸到lwIP棧中 if (tcp_client_connected) { //連接成功則發送數據 xil_printf("TCP Connected"); /* for (int i = 0; i < 30; i++)// { valBuf = acqBuffer[i]; valCh = adcZmod.signedChannelData(channel, valBuf); val = adcZmod.getVoltFromSignedRaw(valCh, gain); adcZmod.formatValue(val_formatted, 1000.0*val, "mV\r\n"); //xil_printf("%d\t%s\t\r\n",i,val_formatted); strcat(sendBuffer,val_formatted); } */ //send_data(); //xil_printf("tran_cnt:%d\r\n", tcp_trans_cnt); xil_printf("Ready to send"); //strcpy(sendBuffer,""); //adcZmod.freeChannelsBuffer(acqBuffer, length); } if (tcp_client_connected==-1) { xil_printf("errorrrrr exit\r\n"); return 0; } //sleep(2); } return 0; } And if I removed the initiate part of ZmodADC uint8_t channel=0; uint8_t gain=0; size_t length=TRANSFER_LEN; ZMODADC1410 adcZmod(ZMOD_ADC_BASE_ADDR, DMA_ADC_BASE_ADDR, IIC_BASE_ADDR, FLASH_ADDR_ADC, ZMOD_ADC_IRQ, DMA_ADC_IRQ); uint32_t *acqBuffer; adcZmod.setGain(channel, gain); acqBuffer = adcZmod.allocChannelsBuffer(length); adcZmod.acquireImmediatePolling(acqBuffer, length); static char time_formatted[15]; uint32_t valBuf; int16_t valCh; float val; int coo; the code of can run successfully. In my opinion, the Eclypse Z7 may have a certain procedure to confirm the normal execution of interrupt processes. When there is any abnormality in the interrupt process, other actions will not be executed. Of course, this is my observation based on experiments, which may not be accurate. If you need any other information, please let me know. Thank you very much.
  4. Hello, about the solution you provided, it raises several questions for me. 1.Since it's the first time that I am using dereferencing, so I am not sure if I am doing it correctly. The code is all in the screenshot. The error code it gives is: Exception: At col 12: Cannot read symbol data. Value of register pc not available in the selected frame for this report issue, it prevents me from reading the data stored in the register I dereferenced. The code compiles without errors, so I suspect there might be something incorrect in my code causing this. 2.If my dereferencing method is correct, then I would like to inquire about the subsequent data packaging method. Our goal is to try if we can transmit the measurement signals received by our ADC through TCP. After receiving your guidance, we found that the problem indeed lies in the conflict of interrupt handlers. From : https://forum.digilent.com/topic/27431-is-it-possible-to-run-tcp-and-zmod_adc-on-eclypse-z7-at-the-same-time/#comment-83944). Thus, if we try to do something further, can you give us some advice or tell us what to do so that we can continue working on our project.
  5. Hello, As title, I'm looking to address certain technical issues through this method, but I couldn't find relevant information online. By the way, the location I want to read is ZMODADC1410_REG_ADDR_TRIG. Thanks for helping me!!!
×
×
  • Create New...