XMC™ Forum Discussions
XMC™
XMC 4700 SPI problem
Solved
Hello,I'm using the XMC4700 relax kit in which is connected an SPI FRam Cypress FM25V02.I have written a simple program that write the value 100 at th...
Show More
Hello,
I'm using the XMC4700 relax kit in which is connected an SPI FRam Cypress FM25V02.
I have written a simple program that write the value 100 at the address 0 of the FRAM, than the value is read.
The problem is during the read because the received value is 0 insted of 100 even if the MISO signal is properly received (the bit frame in the scope contains 100)
All the SPI signals on the scope are OK!!
It seems that value returned by the XMC_SPI_CH_GetReceivedData is not correct!!!
Another strange thing is that if the program is executed slowly step by step with the debugger everything works fine!
It follow the routine used to read the data :
while ((XMC_SPI_CH_GetStatusFlag(XMC_SPI0_CH1) & SPI_MASTER_RECEIVE_INDICATION_FLAG) == 0 )
{
;
}
XMC_SPI_CH_ClearStatusFlag(XMC_SPI0_CH1, (uint32_t) SPI_MASTER_RECEIVE_INDICATION_FLAG );
XMC_SPI_CH_ClearStatusFlag(XMC_SPI0_CH1, (uint32_t) XMC_SPI_CH_STATUS_FLAG_TRANSMIT_SHIFT_INDICATION );
s_dummyData_u16 = XMC_SPI_CH_GetReceivedData(XMC_SPI0_CH1);
s_dummyData_u16 = XMC_SPI_CH_GetReceivedData(XMC_SPI0_CH1);
while (lenght_u16)
{
XMC_SPI_CH_ClearStatusFlag(XMC_SPI0_CH1, (uint32_t) XMC_SPI_CH_STATUS_FLAG_TRANSMIT_SHIFT_INDICATION );
XMC_SPI_CH_ClearStatusFlag(XMC_SPI0_CH1, (uint32_t) SPI_MASTER_RECEIVE_INDICATION_FLAG );
XMC_SPI_CH_Receive(XMC_SPI0_CH1,XMC_SPI_CH_MODE_STANDARD);
while ( !(XMC_SPI_CH_GetStatusFlag(XMC_SPI0_CH1) & XMC_SPI_CH_STATUS_FLAG_TRANSMIT_SHIFT_INDICATION) )
{
}
XMC_SPI_CH_ClearStatusFlag(XMC_SPI0_CH1, (uint32_t) XMC_SPI_CH_STATUS_FLAG_TRANSMIT_SHIFT_INDICATION );
while ( !(XMC_SPI_CH_GetStatusFlag(XMC_SPI0_CH1) & SPI_MASTER_RECEIVE_INDICATION_FLAG) )
{
}
XMC_SPI_CH_ClearStatusFlag(XMC_SPI0_CH1, (uint32_t) SPI_MASTER_RECEIVE_INDICATION_FLAG );
s_dummyData_u16 = XMC_SPI_CH_GetReceivedData(XMC_SPI0_CH1);
*data_pu8 = s_dummyData_u16;
++data_pu8;
--lenght_u16;
} Show Less
I'm using the XMC4700 relax kit in which is connected an SPI FRam Cypress FM25V02.
I have written a simple program that write the value 100 at the address 0 of the FRAM, than the value is read.
The problem is during the read because the received value is 0 insted of 100 even if the MISO signal is properly received (the bit frame in the scope contains 100)
All the SPI signals on the scope are OK!!
It seems that value returned by the XMC_SPI_CH_GetReceivedData is not correct!!!
Another strange thing is that if the program is executed slowly step by step with the debugger everything works fine!
It follow the routine used to read the data :
while ((XMC_SPI_CH_GetStatusFlag(XMC_SPI0_CH1) & SPI_MASTER_RECEIVE_INDICATION_FLAG) == 0 )
{
;
}
XMC_SPI_CH_ClearStatusFlag(XMC_SPI0_CH1, (uint32_t) SPI_MASTER_RECEIVE_INDICATION_FLAG );
XMC_SPI_CH_ClearStatusFlag(XMC_SPI0_CH1, (uint32_t) XMC_SPI_CH_STATUS_FLAG_TRANSMIT_SHIFT_INDICATION );
s_dummyData_u16 = XMC_SPI_CH_GetReceivedData(XMC_SPI0_CH1);
s_dummyData_u16 = XMC_SPI_CH_GetReceivedData(XMC_SPI0_CH1);
while (lenght_u16)
{
XMC_SPI_CH_ClearStatusFlag(XMC_SPI0_CH1, (uint32_t) XMC_SPI_CH_STATUS_FLAG_TRANSMIT_SHIFT_INDICATION );
XMC_SPI_CH_ClearStatusFlag(XMC_SPI0_CH1, (uint32_t) SPI_MASTER_RECEIVE_INDICATION_FLAG );
XMC_SPI_CH_Receive(XMC_SPI0_CH1,XMC_SPI_CH_MODE_STANDARD);
while ( !(XMC_SPI_CH_GetStatusFlag(XMC_SPI0_CH1) & XMC_SPI_CH_STATUS_FLAG_TRANSMIT_SHIFT_INDICATION) )
{
}
XMC_SPI_CH_ClearStatusFlag(XMC_SPI0_CH1, (uint32_t) XMC_SPI_CH_STATUS_FLAG_TRANSMIT_SHIFT_INDICATION );
while ( !(XMC_SPI_CH_GetStatusFlag(XMC_SPI0_CH1) & SPI_MASTER_RECEIVE_INDICATION_FLAG) )
{
}
XMC_SPI_CH_ClearStatusFlag(XMC_SPI0_CH1, (uint32_t) SPI_MASTER_RECEIVE_INDICATION_FLAG );
s_dummyData_u16 = XMC_SPI_CH_GetReceivedData(XMC_SPI0_CH1);
*data_pu8 = s_dummyData_u16;
++data_pu8;
--lenght_u16;
} Show Less
XMC™
We have an XMC4200 project that prints via XMC_DEBUG, and we see on the oscilloscope that each print takes ~10mSec.Also, it seems our CANbus receive i...
Show More
We have an XMC4200 project that prints via XMC_DEBUG, and we see on the oscilloscope that each print takes ~10mSec.
Also, it seems our CANbus receive interrupt is blocked during this 10mSec. If we get more than one CANbus message during the print time, it seems like it is missed.
We tried setting the CANbus receive interrupt priority to 5 (low), yet that did not help.
Is XMC_DEBUG() print wrapped in a critical section? Any thoughts on what to do about this?
If anyone wants details on how we implement XMC_DEBUG, please see the following PDF file and search for the word "print".
http://www.ma2life.org/doc/research/ma2/BuildingBus_Development_Guide.pdf
If anyone wants to see our project, which is free and open (anyone can copy any parts of this for free), they can download from here:
www.ma2life.org/doc/src/BB.zip Show Less
Also, it seems our CANbus receive interrupt is blocked during this 10mSec. If we get more than one CANbus message during the print time, it seems like it is missed.
We tried setting the CANbus receive interrupt priority to 5 (low), yet that did not help.
Is XMC_DEBUG() print wrapped in a critical section? Any thoughts on what to do about this?
If anyone wants details on how we implement XMC_DEBUG, please see the following PDF file and search for the word "print".
http://www.ma2life.org/doc/research/ma2/BuildingBus_Development_Guide.pdf
If anyone wants to see our project, which is free and open (anyone can copy any parts of this for free), they can download from here:
www.ma2life.org/doc/src/BB.zip Show Less
XMC™
Xmc1400 asl bsl mode details
Solved
Hi,I have a processor in ASC BSL Mode(no timeout).I have to change its BMI without using Memtool.So I make a Windows application(Host) for this purpos...
Show More
Hi,
I have a processor in ASC BSL Mode(no timeout).
I have to change its BMI without using Memtool.
So I make a Windows application(Host) for this purpose. It talks in ASC BSL protocol and send a binary file(blinker: a simple led blink application) to the XMC.
(I am using a blinker to see if it works. Ultimetly I will end a BMI changer binary)
But the application I sent is not running. So I think there are 2 reasons for that.
1. I built my blinker application without changing the original linker script. So it is good for running in flash but not sram.
2. Even if my binary file would be built to run properly in ram, there is no start application command or something like that in ASC BSL mode. After the data transfer is complete, how am I suppose to run it?
Now I am investigating how to modify a linker script but it would be appreciated to find one for working a code in SRAM for XMC1400 in here. Because my time is so limited..
And secondly I have to understand how to run this application. I read reference manual and some examples but they didn't help.
Any additional information is more than welcome.
Bests,
İpek Show Less
I have a processor in ASC BSL Mode(no timeout).
I have to change its BMI without using Memtool.
So I make a Windows application(Host) for this purpose. It talks in ASC BSL protocol and send a binary file(blinker: a simple led blink application) to the XMC.
(I am using a blinker to see if it works. Ultimetly I will end a BMI changer binary)
But the application I sent is not running. So I think there are 2 reasons for that.
1. I built my blinker application without changing the original linker script. So it is good for running in flash but not sram.
2. Even if my binary file would be built to run properly in ram, there is no start application command or something like that in ASC BSL mode. After the data transfer is complete, how am I suppose to run it?
Now I am investigating how to modify a linker script but it would be appreciated to find one for working a code in SRAM for XMC1400 in here. Because my time is so limited..
And secondly I have to understand how to run this application. I read reference manual and some examples but they didn't help.
Any additional information is more than welcome.
Bests,
İpek Show Less
XMC™
XMC 4800 Drop in replacement
Solved
Hi, I was wondering if we could treat the XMC 4800 as a drop in replacement for the XMC 4700 (assuming same package, and memory).
XMC™
If i run power conversion via buck conversion with a 500KHz power switching clock then i think that will cause interrupts to run at the 500K rate. is ...
Show More
If i run power conversion via buck conversion with a 500KHz power switching clock then i think that will cause interrupts to run at the 500K rate. is that correct?
also, can i do CANbus transmit and receive while this is going on in the background?
The 500K isr would have priority.
i am not sure how much time it would consume. Perhaps 1uSec out of the 2uSec?
I have not yet done this yet am considering building this with the xmc4200. Show Less
also, can i do CANbus transmit and receive while this is going on in the background?
The 500K isr would have priority.
i am not sure how much time it would consume. Perhaps 1uSec out of the 2uSec?
I have not yet done this yet am considering building this with the xmc4200. Show Less
XMC™
Dear Infineon Team or Jesus, Please can anyone help me with below query ?I am working on EBU region CS1. When I perform a write on memory location say...
Show More
Dear Infineon Team or Jesus,
Please can anyone help me with below query ?
I am working on EBU region CS1. When I perform a write on memory location say 0x64000000, i see data is duplicated at location 0x64002000. This is true for any location.
I am writing 0x0102 at base address and I see same data duplicated after offset of 0x2000. Please see attached photos.
Is this expected behaviour ? Or Am I missing any configuration ?
If this is expected then is EBU compatible to interface with external SRAM ?
Below is my configuration-
Please can you look into my query and let me know your feedback as i am kind of stuck and cant find anymore information.
Thank you
Regards
Query1920 Show Less
Please can anyone help me with below query ?
I am working on EBU region CS1. When I perform a write on memory location say 0x64000000, i see data is duplicated at location 0x64002000. This is true for any location.
I am writing 0x0102 at base address and I see same data duplicated after offset of 0x2000. Please see attached photos.
Is this expected behaviour ? Or Am I missing any configuration ?
If this is expected then is EBU compatible to interface with external SRAM ?
Below is my configuration-
// Zero the configuration structure before we set anything.
configuration.ebu_clk_config.raw0 = 0U;
configuration.ebu_mode_config.raw0 = 0U;
configuration.ebu_free_pins_to_gpio.raw0 = 0U;
// These values get written to the CLC register.
configuration.ebu_clk_config.ebu_clk_mode = 1U; //Fcpu is selected
configuration.ebu_clk_config.ebu_div2_clk_mode = 0U; //standard clocking mode selected
configuration.ebu_clk_config.ebu_clock_divide_rati o = 3U; //Divide by 4 ; Asynchronous cycle Fcpu/4 is used and Febu is not being used
// These values get written to the MODCON register.
configuration.ebu_mode_config.ebu_sdram_tristate = 1U;
configuration.ebu_mode_config.ebu_extlock = 1U;
configuration.ebu_mode_config.ebu_arbsync = 0U;
configuration.ebu_mode_config.ebu_arbitration_mode = 3U; // Master mode.
configuration.ebu_mode_config.bus_timeout_control = 0U;
configuration.ebu_mode_config.ebu_ale_mode = 0U;
// These values get written to the USERCON register.
configuration.ebu_free_pins_to_gpio.address_pins_g pio = 0x0U;
configuration.ebu_free_pins_to_gpio.adv_pin_gpio = 0U;
ebu_bus_read_config.raw0 = 0x40400000U; //EBU_REG_BUSRCON0
ebu_bus_read_config.raw1 = 0X32000189U; // EBU_REG_FPGA_BUSRAP0;
ebu_bus_write_config.raw0 = 0x40400000U; // WRCON
ebu_bus_write_config.raw1 = 0X32002101U; // WRAPR
XMC_EBU_AddressSelectEnable(XMC_EBU, 1U, EBU_CS1);
XMC_EBU_AddressSelectEnable(XMC_EBU, 2U, EBU_CS1);
XMC_EBU_AddressSelectDisable(XMC_EBU, 4U, EBU_CS1);
Please can you look into my query and let me know your feedback as i am kind of stuck and cant find anymore information.
Thank you
Regards
Query1920 Show Less
XMC™
Boot Mode Index (BMI) can be change via Memtool. First, connect the device with Memtool. The device can be connect via UART BSL if the device is in UA...
Show More
Boot Mode Index (BMI) can be change via Memtool.
First, connect the device with Memtool. The device can be connect via UART BSL if the device is in UART BSL mode or connect via DAS if the device in SWD or SPD mode.
For connect via DAS, Infineon miniWiggler is required.
Next, go the "Setup" in Memtool and select the "Protection/BMI" tab.
Check on the box of "Intall BMI configuration" and choose the Boot Mode you want to change, then click "OK".
The next go to "HW Protect", select "Change current Protection and BMI configuration" and click "Start".
Once it is done, Memtool will prompt "Protection operation failed" as we do not set anything for the protection.
Then reset your device and it will go into the boot mode you have selected.
WARNING: You must know what you are doing. Once you have changed the BMI, you must have the mean to connect to the device using the mode you have change. Show Less
First, connect the device with Memtool. The device can be connect via UART BSL if the device is in UART BSL mode or connect via DAS if the device in SWD or SPD mode.
For connect via DAS, Infineon miniWiggler is required.
Next, go the "Setup" in Memtool and select the "Protection/BMI" tab.
Check on the box of "Intall BMI configuration" and choose the Boot Mode you want to change, then click "OK".
The next go to "HW Protect", select "Change current Protection and BMI configuration" and click "Start".
Once it is done, Memtool will prompt "Protection operation failed" as we do not set anything for the protection.
Then reset your device and it will go into the boot mode you have selected.
WARNING: You must know what you are doing. Once you have changed the BMI, you must have the mean to connect to the device using the mode you have change. Show Less
XMC™
Hi,I am working on XMC1100 Controller, i am trying to run an application by loading by using ASCBSL mode, but i am fail to do it. I approached followi...
Show More
Hi,
I am working on XMC1100 Controller, i am trying to run an application by loading by using ASCBSL mode, but i am fail to do it. I approached following procedure as per the xmc1000 tooling guide
---> sent 0x00 and 0x6C from UART to the Target
<--- Got Reply 0x5D as Positive Response
---> sent Length in little Endian format
<--- Got Reply 0x01 as Positive Response
---> Sent Application Stream
<--- Got Reply 0x01 as Positive Response, so that i confirmed that my Application was successfully Accepted.
now I am waiting for the application to be run but it wont
Note: Here my Application is blink an Led
Could any one suggest where might be the wrong????
Thanks and Regards,
Harshan. Show Less
I am working on XMC1100 Controller, i am trying to run an application by loading by using ASCBSL mode, but i am fail to do it. I approached following procedure as per the xmc1000 tooling guide
---> sent 0x00 and 0x6C from UART to the Target
<--- Got Reply 0x5D as Positive Response
---> sent Length in little Endian format
<--- Got Reply 0x01 as Positive Response
---> Sent Application Stream
<--- Got Reply 0x01 as Positive Response, so that i confirmed that my Application was successfully Accepted.
now I am waiting for the application to be run but it wont
Note: Here my Application is blink an Led
Could any one suggest where might be the wrong????
Thanks and Regards,
Harshan. Show Less
XMC™
I downloaded the .exe file, and I tried to run it but windows does not recognize it as an executable file thinking it was a dave4 project I tried to i...
Show More
I downloaded the .exe file, and I tried to run it but windows does not recognize it as an executable
file thinking it was a dave4 project I tried to import it but in this case I have a mistake you can kindly
tell me what kind of file it is Show Less
file thinking it was a dave4 project I tried to import it but in this case I have a mistake you can kindly
tell me what kind of file it is Show Less
XMC™
Hey everyone,I'm a new XMC1100 user, and I'm trying to modify my linker script in DAVE to put all code in RAM. I modified the ".text" section to look ...
Show More
Hey everyone,
I'm a new XMC1100 user, and I'm trying to modify my linker script in DAVE to put all code in RAM. I modified the ".text" section to look like the ".ram_code" section, however, my program is restarting at the __copy_data branch instruction. I suspect I need to keep this startup code in text, but move everything else.
Does anyone have a linker script that loads all code into RAM, and then executes from there instead of flash?
I'm trying to get power consumption down, and I realized the memory capacity on this XMC1100 part is "backwards" — it has 16K of RAM, and 8K of flash 🙂
Thanks! Excited to get started with XMC! Show Less
I'm a new XMC1100 user, and I'm trying to modify my linker script in DAVE to put all code in RAM. I modified the ".text" section to look like the ".ram_code" section, however, my program is restarting at the __copy_data branch instruction. I suspect I need to keep this startup code in text, but move everything else.
Does anyone have a linker script that loads all code into RAM, and then executes from there instead of flash?
I'm trying to get power consumption down, and I realized the memory capacity on this XMC1100 part is "backwards" — it has 16K of RAM, and 8K of flash 🙂
Thanks! Excited to get started with XMC! Show Less