Bui Cuong

Members
  • Content Count

    7
  • Joined

  • Last visited

About Bui Cuong

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. So @jpeyron, i just think that code only permit to transmit 1 packet so we need to alter some functions in that code. And the memory allocate as above code, i think it does not matter. Can you give me a reason why we need change memory instead of functions.
  2. Thank @jpeyron, this is my Linker Script. but i think my problem in my code like in this post https://forums.xilinx.com/t5/7-Series-FPGAs/Artix-7-How-to-config-DMA-to-transmit-more-than-one-BD-in/td-p/903680 It means how to config in TX channel to transmit more than one packet: XAxiDma_BdSetCtrl(). This is my project: https://drive.google.com/open?id=16PBdsWDXbVUHlbFP7fXQ--xB0nVR_B33
  3. @jpeyron I am just a newbie. Can you explain more detail for me ?
  4. I am learning to use DMA in Scatter Gather mode. So i use example code ("xaxidma_example_sg_poll.c"). Using "xil_printf" function to see value, I am done with this but it only transmit 1 BD, and i want more. I edit "SendData" function like this to transmit 2 BDs. // i edit this code to transmit more than 1 BD static int SendPacket(XAxiDma * AxiDmaInstPtr) { XAxiDma_BdRing *TxRingPtr; u8 *TxPacket; u8 Value; XAxiDma_Bd *BdPtr; int Status; int Index; TxRingPtr = XAxiDma_GetTxRing(AxiDmaInstPtr); /* Create pattern in the packet to transmit */ TxPacket = (u8 *) Packet; Value = TEST_START_VALUE; for(Index = 0; Index < 2*MAX_PKT_LEN; Index ++) { TxPacket[Index] = Value; xil_printf ("TX addr: %x and value: %x\n\r", (unsigned int)(TxPacket+Index),(unsigned int)*(TxPacket+Index)); Value = (Value + 1) & 0xFF; } /* Allocate 2 BD */ Status = XAxiDma_BdRingAlloc(TxRingPtr, 2, &BdPtr); if (Status != XST_SUCCESS) { return XST_FAILURE; } for (Index = 0; Index < 2;Index ++){ /* Set up the BD using the information of the packet to transmit */ Status = XAxiDma_BdSetBufAddr(BdPtr, (UINTPTR) Packet); if (Status != XST_SUCCESS) { xil_printf("Tx set buffer addr %x on BD %x failed %d\r\n", (UINTPTR)Packet, (UINTPTR)BdPtr, Status); return XST_FAILURE; } Status = XAxiDma_BdSetLength(BdPtr, MAX_PKT_LEN, TxRingPtr->MaxTransferLen); if (Status != XST_SUCCESS) { xil_printf("Tx set length %d on BD %x failed %d\r\n", MAX_PKT_LEN, (UINTPTR)BdPtr, Status); return XST_FAILURE; } xil_printf ("TX BD addr: %x and value: %x\n\r", BdPtr,TxPacket); /* For single packet, both SOF and EOF are to be set */ XAxiDma_BdSetCtrl(BdPtr, XAXIDMA_BD_CTRL_TXEOF_MASK | XAXIDMA_BD_CTRL_TXSOF_MASK); XAxiDma_BdSetId(BdPtr, (UINTPTR)Packet); TxPacket += MAX_PKT_LEN; BdPtr = (XAxiDma_Bd *)XAxiDma_BdRingNext(TxRingPtr, BdPtr); } /* Give the BD to DMA to kick off the transmission. */ Status = XAxiDma_BdRingToHw(TxRingPtr, 2, BdPtr); if (Status != XST_SUCCESS) { xil_printf("to hw failed %d\r\n", Status); return XST_FAILURE; } return XST_SUCCESS; } And error appear from "XAxiDma_BdRingToHw()" function . Any suggestion for me ? Thank P.S: xaxidma_example_sg_poll.c : full code file I will post my project file soon.
  5. thank @BogdanVanca, i updated all IP as you said and add IP license. And it works.
  6. Hi everyone, My friend send me his project, but when I open it, it appear this error. All IPs is locked and cannot be customized. He and me use different vivado version. What is the problem ? The Pic: https://drive.google.com/open?id=1A0YhredaNk6Xr5VDGFh0XHj53PlmkfuX My project: https://drive.google.com/open?id=143_PRM7hTM-qg6JAXrBS_Tb-P-bnT5lR
  7. now I configure XADC on Zynq-702 Evaluation Board to measure voltage (0->1 V) on VP_VN, Vaux_8 and Vaux0. The problem is: When I see the value on Tera Term VT, the values of VP_VN, Vaux_8, and Vaux0 don't change when changing the external voltage value. They only change when I reset the system or when I start Programing HW(.bit) and Launching SW (.elf) into Kit again . Any suggestion for me? This is my HW: This is my SW (SDK): #include <stdio.h> #include "platform.h" #include "xadcps.h" #include "xil_types.h" #include "sleep.h" #define XPAR_AXI_XADC_0_DEVICE_ID 0 #define XAdcPs_RawToExtVoltage(AdcData) ((((float)(AdcData))* (1.0f))/65536.0f) static XAdcPs XADCMonInst; int main() { XAdcPs_Config *ConfigPtr; XAdcPs *XADCInstPtr = &XADCMonInst; int Status_ADC; // VP_VN u32 VP_VNRaw; float VP_VNData; // Vaux 0 u32 Vaux_0Raw; float Vaux_0Data; // Vaux 8 u32 Vaux_8Raw; float Vaux_8Data; // Vref P u32 VrefPRaw; float VrefPData; init_platform(); printf("Man and Device \n "); // XADC initial ConfigPtr = XAdcPs_LookupConfig(XPAR_AXI_XADC_0_DEVICE_ID); if (ConfigPtr == NULL ){ return XST_FAILURE; } Status_ADC = XAdcPs_CfgInitialize(XADCInstPtr,ConfigPtr,ConfigPtr->BaseAddress); if ( XST_SUCCESS != Status_ADC ){ printf("XADC failed initial"); return XST_FAILURE; } // self test XADC Status_ADC = XAdcPs_SelfTest(XADCInstPtr); if (XST_SUCCESS != Status_ADC){ printf("XADC failed self test"); return XST_FAILURE; } XAdcPs_SetSequencerMode(XADCInstPtr,XADCPS_SEQ_MODE_SAFE); XAdcPs_SetSeqChEnables(XADCInstPtr,XADCPS_CH_VPVN|XADCPS_CH_AUX_MIN|XADCPS_CH_AUX_08|XADCPS_CH_VREFP); XAdcPs_SetSeqInputMode(XADCInstPtr,XADCPS_CH_VPVN|XADCPS_CH_AUX_MIN|XADCPS_CH_AUX_08); XAdcPs_SetAvg(XADCInstPtr,XADCPS_AVG_64_SAMPLES); XAdcPs_SetSequencerMode(XADCInstPtr,XADCPS_SEQ_MODE_CONTINPASS); while(1){ // VP_VN VP_VNRaw = XAdcPs_GetAdcData(&XADCMonInst,XADCPS_CH_VPVN); VP_VNData = XAdcPs_RawToExtVoltage(VP_VNRaw); printf("Raw VP_VN %lu Data VP_VN %f \n\r", VP_VNRaw, VP_VNData); // Vaux0 Vaux_0Raw = XAdcPs_GetAdcData(&XADCMonInst,XADCPS_CH_AUX_MIN); Vaux_0Data = XAdcPs_RawToExtVoltage(Vaux_0Raw); usleep(1); printf("Vaux_0Raw %lu Vaux_0Data %f \n\r", Vaux_0Raw, Vaux_0Data); //Vaux 8 Vaux_8Raw = XAdcPs_GetAdcData(&XADCMonInst,XADCPS_CH_AUX_08); Vaux_8Data = XAdcPs_RawToExtVoltage(Vaux_8Raw); printf("Vaux_8Raw %lu Vaux_8Data %f \n\r", Vaux_8Raw, Vaux_8Data); //VrefP VrefPRaw = XAdcPs_GetAdcData(&XADCMonInst,XADCPS_CH_VREFP); VrefPData = XAdcPs_RawToVoltage(VrefPRaw); printf("VrefPRaw %lu VrefPRaw %f \n\r", VrefPRaw, VrefPData); printf("\n"); printf("\n"); // delay function usleep(500000); // delay 5ms } return 0; } This is my Tera Term VT (to see external voltage : ) They dont change value when changing external voltage on VP_VN, Vaux_8, and Vaux0 .