XMC™ Forum Discussions
We are developing embedded firmware for an XMC4700 using DAVE (version 4.5.0) with the USB DAVE apps:
- USBD (version 4.0.16)
- USBD_VCOM (version 4.0.12)
Our product has a USB-C port that is wired into the USB controller on our XMC4700. We're trying to create a serial connection between an Android host device and the XMC4700. However, Android does not detect the XMC4700 at all.
We've tried registering a device_filter.xml file with the following entries:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Infineon XMC 4700 -->
<usb-device vendor-id="1419" product-id="80" />
<usb-device vendor-id="1419" product-id="88" />
</resources>
Usually, when Android detects a connected USB device, it will launch our application and auto-prompt the user for permission. In our case, we have no indication from Android that anything is present on the USB port.
Some of our other embedded products use FTDI USB chips, and these work fine with Android, so not sure what the issue is.
We're using this library on Android: https://github.com/mik3y/usb-serial-for-android
This library does not detect any connected devices.
On the firmware side of things, I register the USB "connect" event, this fires when I connect to a Windows PC, but not when I connect to Android.
The USB port is powered off a 24 VDC power supply, so it wouldn't be that the Android device isn't supplying enough current.
Any ideas? Thanks for your time.
Show Less
I am looking for some firmware how to configure the RS232 xmit/rec.
Thanks
I have two analog signals in the shape of a gaussian curve having an amplitude of about 500 mv and duration of 20 microseconds. These pulses happen at irregular intervals of about every 400 microsecond. I am measuring the amplitude of these signal with two channels of the onboard ADC operating as fast as possible so that the shape of the pulses can be quantified. Using two channels means that a measurement on one channel is slightly behind the other by about 2 microseconds. This creates an error in my data.
Question 1.
I am aware that there are more than one ADC device in my XMC 4700 board. I see references to simultaneous ADC measurements. Reading the documents, seems like it is doable. Reading the documents offers no clue on how to actually it. Can anyone help me out with actual code to do the job?
Question 2:
In my code, a conversion seems to take about 2 microseconds. All the fat is removed from the code to make the ADC to run as fast as possible. In the ADC measurement setup, an 8 bit ADC is supposed to done in 430 nsec. This is not the case for me. Is there some special trick that has to be done to achieve the published speed?
Show Less
Hi,
I ask for some details on the following routine, that is the erase of a sector for the on-chip flash.
int EraseSector (unsigned long adr) {
M32(FLASH_NoCACHE + 0x5554) = 0xF5; // Start Clear Status Command
M32(FLASH_NoCACHE + 0x5554) = 0xAA; // Start Block Erase Command
M32(FLASH_NoCACHE + 0xAAA8) = 0x55;
M32(FLASH_NoCACHE + 0x5554) = 0x80;
M32(FLASH_NoCACHE + 0x5554) = 0xAA;
M32(FLASH_NoCACHE + 0xAAA8) = 0x55;
M32(adr | FLASH_OFFS) = 0x30; // erase logical sector
while (FLASH0->FSR & FSR_PBUSY); // Wait until Erase completed
if (FLASH0->FSR & FSR_ERR) { // Check for Error
return (1); // Failed
}
return 0;
}
I guess that from the instruction "M32(adr | FLASH_OFFS) = 0x30" on, it is no more possible to perform a fetch from the on-chip flash, until the erase is completed.
Anyway, the CPU can execute the instruction "while (FLASH0->FSR & FSR_PBUSY)", because the fetch of that instruction is performed from the flash cache. Isn't it?
During the flash erase, we should avoid the execution of other parts of our firmware, in order to avoid cache misses. I guess that, if I try to execute another thread during the sector erase, a flash cache miss could happen and a fetch from flash won't be possible, causing the execution to get stuck.
Could you please confirm these statements?
Thank you,
Regards
Show LessDear sir / madam,
I amtrying to implement a bootloader program.
It works fine until I add in more code. It seems the extra code clashes with the AMB header and I get the message below.
.abm loaded at [0c00ffe0,0c00fff3] overlaps section .text loaded at [0c000000,0c011b87]
ABM header:
.abm ABSOLUTE(0x0800FFE0): AT(0x0800FFE0 | 0x04000000)
{
KEEP(*(.flash_abm))
} > FLASH_1_cached
The extra code is added when i add the Ethernet Lwip app.
I've tried different things with the linker file to try and place the code around the ABM header, but had no success so far. I would have though since the ABM header is declared in the linker the compiler owuld have avoided placing code near that section. Is there a way the linker can select different sections to overcome the problem, e.g.
place Flash 1 before the abm header, and place Flash 1 after the abm header?
or place the Ethernet Lwip code after the abm header?
I've attached the project.
thanks
Brendan
Show Less
Hello there,
I'm trying to create a EtherCAT slave device based on XMC4800 and ADIN1200. I've generated a firmware according to the "Getting started with XMC4800 EtherCAT" video tutorial (LINK ) on YouTube. I've ran the procedure with DAVE IDE, then I created configuration file with SSC. I tried with both 5.12 and 5.13 versions. Then I copied the XML and Excel files to the TwinCAT 3 IO config directory, which in my case is "C:\TwinCAT\3.1\Config\Io\EtherCAT". The physical connection is made through Realtek USB to Ethernet adapter.
In TwinCAT 3, I created an Infineon master device. However, I stuck at the BOX search procedure. It can't find the BOX and establish a connection between the PC and slave device. All the packages are lost.
On the oscilloscope, I can see that there are some packages coming from the PC at intervals within about one second. However, the LINK and LINK_ACK LEDs are off and also there is nothing on the MII lines. LINK_ST stays at logic LOW...
All the clocks are present. Voltages are stable. Reset is HIGH (3.3V)
My schematic is based on the Relax kit datasheet. (LINK )
What could be wrong?
Please check screenshots below!
Best regards!
Show LessHello everyone,
I am changing the BCM5241 PHY to ADIN1200 PHY, because BCM5241 is obsolete.
My source code works fine with the BCM5241, but there seems to be a problem with the ADIN1200 PHY.
I use ADIN1200 based on "XMC4300_Relax_EtherCAT_Kit_V2.1" design, after powering on, connecting RJ45 to Laptop, I can't scan BOX, and I don't see ACT LED and LINK LED working.
Please suggest me how to solve this problem, thank you everyone!
Show LessHi folks,
I am using a XMC4400 MCU based board, and working on the CAN communication. DAVE is the IDE I am using for this.
The situation is, the communication is performing well at the beginning, but after sending some tens of CAN messages, it stopped. Tried many times but this behavior persists. After investigation during debugging, the issue occurs in XMC_CAN_MO_Transmit() function, which returns XMC_CAN_STATUS_BUSY status, and all the following transmission stucks at the same cause.
After resetting the board, (my expression may not be accurate -- for my case I mean stop/restarting the debugging in DAVE), the CAN comm is back to work, but again, stopped by XMC_CAN_STATUS_BUSY after tens of messages sent.
The sending is at once-per-second level frequency which I think far from high. Also, I tried different CAN devices as the receiver, the issue still persists, so I assume it is not the connection, or the recepient CAN node's problem.
My CAN configuration are done by auto-generation based on the hardware signal connection setup. In the codes, the CAN comm relevant scripts are basically things like
CAN_NODE_0.lmobj_ptr[2]->mo_ptr->can_data_word[0] = a;
CAN_NODE_0.lmobj_ptr[2]->mo_ptr->can_data_word[1] = b;
XMC_CAN_MO_UpdateData(CAN_NODE_0.lmobj_ptr[2]->mo_ptr);
XMC_CAN_MO_Transmit(CAN_NODE_0.lmobj_ptr[2]->mo_ptr);
called in a 1 sec interval tick function.
Could you share some advice on the possible reason of the busy status?
Or, is there an method to reset the message object on a transmission failure, like clearing the busy status and message data etc. and be ready for the transmission next round?
Appreciate for your responses.
Regards,
Wei
Show Less
Hi, I am trying to get the FPU going on XMC4200 but for some reason I am not able to get the expected performance. I am using the latest version of DAVE.
In the attached project:
1. I enabled the FPU: SCB->CPACR |= 0x00F00000; //Enable FPU
2. I have two functions, a square root and a multiplication and some pin toggles for time measurements on the oscilloscope.
3. I measure approximately 390 clock cycles for the square root and 26 clock cycles for the multiplication. I think these times are too long and they don't change much even if the FPU is not enabled. So, I think I am not using the FPU correctly.
I would very much appreciate it if anyone can help me to find the problem. I tried all the suggestions in this forum by changing the active project properties but observed no improvement.
I also copied the "main.c" file below, which is the only file that I created in the project.
I look forward to hearing from you. Thanks in advance.
Yalcin
========main.c========
Hello,
I recently acquired the evaluation board in the title. Other than the "Validation set up" in the application notes doc, I haven't been able to locate any user manual or user guide.
When I hook up the eval board input to 400VDC, I am not getting any output. I see a green LED on the microcontroller board, and the red and orange are flashing. The board draws about 4 mA from the supply.
I have ordered an XMC link cable to use the GUI interface, but I was under the impression that the unit would be pre programmed to go 400VDC in 51 VDC out.
Is there any setup guide or troubleshooting steps I should be following?
Show Less