Quantcast
Channel: Infineon Forums
Viewing all 9892 articles
Browse latest View live

XMCLib BUG: XMC_SCU_ReadFrom/WriteToRetentionMemory

$
0
0
This is the code for the XMC_SCU_ReadFrom/WriteToRetentionMemory functions in xmc4_scu.c:

Code:

/* API to write into Retention memory in hibernate domain */
void XMC_SCU_WriteToRetentionMemory(uint32_t address, uint32_t data)
{
  uint32_t rmacr;
 
  /* Get the address right */ 
  rmacr = (uint32_t)((address << SCU_GENERAL_RMACR_ADDR_Pos) & (uint32_t)SCU_GENERAL_RMACR_ADDR_Msk);
 
  /* Transfer from RMDATA to Retention memory */
  rmacr |= (uint32_t)(SCU_GENERAL_RMACR_RDWR_Msk);
 
  /* Write desired data into RMDATA register */ 
  SCU_GENERAL->RMDATA = data;
 
  /* Write address & direction of transfer into RMACR register */ 
  SCU_GENERAL->RMACR = rmacr;
 
  /* Wait until the update of RMX register in hibernate domain is completed */
  while((SCU_GENERAL->MIRRSTS) & SCU_GENERAL_MIRRSTS_RMX_Msk)
  {
  }
}

/* API to read from Retention memory in hibernate domain */
uint32_t XMC_SCU_ReadFromRetentionMemory(uint32_t address)
{
  uint32_t rmacr;

  /* Get the address right */ 
  rmacr = ((uint32_t)(address << SCU_GENERAL_RMACR_ADDR_Pos) & (uint32_t)SCU_GENERAL_RMACR_ADDR_Msk);
 
  /* Transfer from RMDATA to Retention memory */
  rmacr |= (uint32_t)(SCU_GENERAL_RMACR_RDWR_Msk);
 
  /* Writing an adress & direction of transfer into RMACR register */ 
  SCU_GENERAL->RMACR = rmacr;
 
  /* Wait until the update of RMX register in hibernate domain is completed */
  while((SCU_GENERAL->MIRRSTS) & SCU_GENERAL_MIRRSTS_RMX_Msk)
  {
  }

  return (SCU_GENERAL->RMDATA);
}

In both functions, the RDWR bit of the RMACR is set to write using rmacr |= (uint32_t)(SCU_GENERAL_RMACR_RDWR_Msk);. Shouldn't this be omitted from the XMC_SCU_ReadFromRetentionMemory function?

I am also concerned about the lack of checking for the RMX flag before transfers are initiated. It appears the two functions make the assumption that no other code accesses the retention memory.

Fault debugging doesn't work

$
0
0
Hello,

I'm trying to debug issues with using the retention memory. I am getting Hard Faults, I believe. I have enabled Hard Fault debugging using CPU_CTRL_XMC4 App, but the debugger never breaks, it just keeps running and when I manually break, the program counter is in the VADC0_G3_3_IRQHandler Default Handler.

1) What does this actually mean? I'm pretty sure there's no reason for VADC0_G3_3_IRQHandler to actually be called, it must be masking a different (default) handler.

2) If this is actually the result of a hard fault, what could be the reasons the debug support isn't working? Are there any compiler options needed to make it work?

XMC1400 Time Measurement Jitter Problem

$
0
0
Hello,

I want to measure time with the XMC1400 BootKit.
The timer modul CCU4 is started and stopped by external events.
If I use the internal oscillator DCO1 (48 Mhz), the jitter of the measured counts increases.
At 50 microsec the jitter is under 5 counts, but at 200 microsec the jitter is already around 15 counts.
The jitter of the counts increases nearly linear with the measured time.
I know that using a crystall oscillator solves the problem.

But which effect causes this phenomenon ?
I would expect that the jitter is constant.

Thanks

Displaycontrolling via Epson S1D13781 using XMC1300

$
0
0
XMC1300 does not have a PLL. I think there is more code manipulation that is necessary to port from XMC4700 to XMC1300. I would start by creating a new XMC1300 project, and then manipulating apps to match XMC4700.

Bootloader running from Flash

$
0
0
Quote:

Originally Posted by SarathBlues View Post
Hey OMR,

Thanks to you I am now able to jump to application. Thanks again :)

Also few querries coming to my mind:

1) If we do not configure any ABM and we run the code doesnt it always come to 0x0800000? Why cant we have just one Bootloader at 0x0800000 lets size 10k.keep the app on a higher section lets say 0x08004000. Always first come to booter main() and decide whether to erase and program or directly jump to App_main? Do you think this is a good idea?

2) for the APP all interrupt vector table and the services are stored where? How did you handle the interrupts in the APP. did you make any proxy interrupts in the APP? im sorry I am bugging you. But this is my first attempt at a booter and you are my only savior :)

Sarath



I wish to SarathBlues strategy? How can I then jump from boot to application provided that two images coexists separately and in completeness. The same like this ?

const uint32_t APP_START_ADDRESS = 0x08020000;


void Booter::startApplication()
{
taskENTER_CRITICAL(); // turn off global interrupt. This command is freeRTOS specific. See XMC4500 reference manual for doing it directly in the CPU.
PPB->VTOR = APP_START_ADDRESS;
asm(
"ldr sp, [%0]\n\t"
"ldr r0, [%0, #4]\n\t"
"bx r0"
:
: "r" (APP_START_ADDRESS)
:);
}

XMC4500 Ethernet Interface Station Management Functions

$
0
0
Hello,

I am using a XMC4500 with a physical chip from Micrel (KSZ8863mll).
I'd like to use the advanced functions like power saving features and cable diagnostics.
In order to do that, I need to send Messages with OPCODE=00b. See in the attached datasheet page 33

The XMC's reference manual only mentions OPCODES 10b and 01b (chapter 15.2.8.1).

Anybody knows a way to set the OPCODE directly?

Thanks, Michael
Attached Files

Ethernet demo falshing to TC299B

$
0
0
This is my current code using the demo. I had to comment out all printfs as they made the debugger crash. I am using the UDE debugger and the HighTec toolchain, all of which is the free or lite toolchain from Infineon homepage.
The issue is that no communication is made on the ethernet, I have tried listening with wireshark on multiple OS's (Linux and Windows). Could somebody please inform me why nothing is transmitted by the ethernet port on the hardware?

I have also tried the below code with sending an ARP, and listen and view the information on a switch. No communication seems to be transmitted. Is it possible to get some support on what I might be missing?

void EthDemo_init(void)
{
/* configure Ethermac */
{
const IfxEth_RmiiPins pins = {
&IfxEth_CRSDVA_P11_11_IN,
&IfxEth_REFCLK_P11_12_IN,
&IfxEth_RXD0_P11_10_IN,
&IfxEth_RXD1_P11_9_IN,
&IfxEth_MDC_P21_0_OUT,
&IfxEth_MDIO_P21_1_INOUT,
&IfxEth_TXD0_P11_3_OUT,
&IfxEth_TXD1_P11_2_OUT,
&IfxEth_TXEN_P11_6_OUT
};

IfxEth_Config config;
//config.macAddress = myMacAddress;
IfxEth_initConfig(&config, &MODULE_ETH);

config.phyInterfaceMode = IfxEth_PhyInterfaceMode_rmii;
config.rmiiPins = &pins;
config.phyInit = &IfxEth_Phy_Pef7071_init;
config.phyLink = &IfxEth_Phy_Pef7071_link;

IfxEth_init(&g_Eth.drivers.eth, &config);

/* activate loopback */
IfxEth_setLoopbackMode(&g_Eth.drivers.eth, 0);

/* and enable transmitter/receiver */
IfxEth_startTransmitter(&g_Eth.drivers.eth);
IfxEth_startReceiver(&g_Eth.drivers.eth);

IfxEth_setMacAddress(&g_Eth.drivers.eth,myMacAddre ss);
}

/*printf("Eth is initialised\n");*/
}


/** \brief Demo run API
*
* This function is called from main, background loop
*/
void EthDemo_run(void)
{
/*printf("Ethernet transfers in loopback mode are started\n");*/

/* send 5 packets, each contains 8 bytes */
const uint32 numPackets = 5;
const uint32 packetSize = 8;

uint32 packet;

for (packet = 0; packet < numPackets; ++packet)
{
uint8 *pTxBuf = (uint8 *)IfxEth_waitTransmitBuffer(&g_Eth.drivers.eth);

/*printf("TX #%d\n", packet + 1);*/

/* DA */
const uint8 packetId = 0x10 * packet;
uint32 i;

for (i = 0; i < 6; i++)
{
pTxBuf[i] = extMacAddress[i];
}
/* SA */
for (i = 0; i < 6; i++)
{
pTxBuf[i+6] = myMacAddress[i];
}

/* length of payload */
pTxBuf[12] = packetSize / 256;
pTxBuf[13] = packetSize % 256;

for (i = HEADER_SIZE; i < (HEADER_SIZE + packetSize); i++)
{
pTxBuf[i] = packetId | (i % 16);
}

/* send packet */
IfxEth_clearTxInterrupt(&g_Eth.drivers.eth);
IfxEth_setAndSendTransmitBuffer(&g_Eth.drivers.eth , pTxBuf, HEADER_SIZE + packetSize);
// IfxEth_sendTransmitBuffer(&g_Eth.drivers.eth, HEADER_SIZE + packetSize);

while (IfxEth_isTxInterrupt(&g_Eth.drivers.eth) == FALSE)
{}
}

/* check the 5 received packets */
uint32 errors = 0;

for (packet = 0; packet < numPackets; ++packet)
{
/*printf("RX #%d\n", packet + 1);*/

#if 0

/* only one interrupt for all the received packets so far... */
while (IfxEth_isRxInterrupt(&g_Eth.drivers.eth) == FALSE)
{}

IfxEth_clearRxInterrupt(&g_Eth.drivers.eth);
#else

if (IfxEth_isRxDataAvailable(&g_Eth.drivers.eth) != TRUE)
{
++errors;
}

#endif
uint8 *pRxBuf = (uint8 *)IfxEth_getReceiveBuffer(&g_Eth.drivers.eth); /* we expect that a packet is available */
IfxEth_freeReceiveBuffer(&g_Eth.drivers.eth);

/* DA */
const uint8 packetId = 0x10 * packet;
uint32 i;

for (i = 0; i < 6; i++)
{
if (pRxBuf[i] != myMacAddress[i])
{
++errors;
}
}

/* SA */
for (i = 0; i < 6; i++)
{
if (pRxBuf[i + 6] != myMacAddress[i])
{
++errors;
}
}

/* length of payload */
if (pRxBuf[12] != (packetSize / 256))
{
++errors;
}

if (pRxBuf[13] != (packetSize % 256))
{
++errors;
}

for (i = HEADER_SIZE; i < (HEADER_SIZE + packetSize); i++)
{
if (pRxBuf[i] != (packetId | (i % 16)))
{
++errors;
}
}
}

/*printf("Expect that no additional receive data is available:");*/

if (IfxEth_isRxDataAvailable(&g_Eth.drivers.eth) != FALSE)
{
++errors;
}

IFX_ASSERT(IFX_VERBOSE_LEVEL_ERROR, errors == 0);

if (errors)
{
/*printf("ERROR: Found (%d errors)\n", errors);*/
}
else
{
/*printf("OK: Checks passed\n");*/
}
}

RTOS aware debugging!

$
0
0
I didn't.
No priority for me right now.

XMC4500 cannot flash

$
0
0
Nevermind, it must be an intermittent short circuit in the power supply circuitry or something like that. After letting the device sit for a while and turning it back on the voltage is now 3.3V and the XMC is working.

XMC 4500 Ethernet failure

Problems with CAN TX FIFO (illds)

$
0
0
Hi,
i've got a problem with the illds for the CAN interface.
I would like to use a fifo queue each for the tx and the rx direction.
I used the same approach as described in the example in the documentation,
however i only got the rx fifo working,
as soon as i try to use a queue for the tx direction the txrq won't be cleared after a short period of time.
Is there anything special I have to do to use a queue for the tx direction compared to the rx direction ?

Thanks in Advanced

Getting Started Example - Boot Kit XMC1400 - Won't build.

$
0
0
Rick,

Thanks. I really wish that they would have included the link in their presentation.

Now I can get back to business.

Greatly appreciated.

GPIO Interrupt setup

$
0
0
Hello,

I have a keypad connected to GPIO's. At first I tried polling the keys in the while(1) loop and that worked fine as long as there were no other interrupts. Now I have an ADC configured that's in background scan mode so it keeps interrupting. I want to connect the keypad using ERU to an NVIC so I can use interrupts but it won't work.
I have set up the pins that should go up when I press using IO002 apps, connected the pad signal to ERU001 signal input a, connected ERU001 trigger pulse output to ERU002 trigger input, connected ERU002 gated output to NVIC interrupt node. What am I doing worng? Did I miss something?

XMC4800 EtherCAT CiA402 Profile

$
0
0
Hello
Is there any example project or sample OD file (xls) for CiA402 motion profile on XMC4800? I try to modify the OD in XMC4800_Relax_EtherCat_APP_Slave_SSC example but SSC doesn't regconize the CiA402 profile, RxPDO, TxPDO.
I am really appriciate for any help!

VADC setting alternate reference voltage

$
0
0
Hello everyone,

Does anyone have an example code to change the reference voltage for an ADC003 for standard to CH0? I know I should set GxCHCTRy.REFSEL but I don't really know how to do that...

Thanks

Problems with creation and handling of Projekts

$
0
0
Hallo there,

I have some problems with the Dave Software.
If I create a Dave-Project with Dave v4.2.8, I can't finish the prozess because there is no reaction if I click on the "next" -button.
If I import a Dave-Project, I can't see the for example the memory settings at project properties. There displayed following message: "This page can be displayed only when single configuration is selected. Re-launch the dialog and avigate to this page after selecting single configuration."
And if I build and debug the imported project, there isn't the "start" button to start the program.
But what is single configuration? How can I fix the problems? Can somebody help me?

Best Regards
Hendrik Thiele

P.S.: I'm using the XMC4500 100 - 1024

Errors Following XMC4300 Getting Started

$
0
0
Whoever made the corrections, thank you. Page 21 and 22 are duplicates now though.

XMC1100 - special UART Command to leave User Productive Mode

$
0
0
Hello,

Can you check what is the current BMI mode for the device?
Attachment 2464

If it is ASC mode, can you switch to User mode (debug) SWD0?

Or do you mean the device is totally not accessible anymore?

Regards,
Min Wei
Attached Images

Cannot run two independent SPI_MASTER module concurrently

$
0
0
Hello,

I think the statement is referring to the case of a single USIC channel.
Here, it makes sense that receive interrupt has the higher priority such that any old received data is cleared from the buffer before new data is received (due to the next transmit sequence).

For your case, since they are different USIC modules, I don't think this statement applies.

Regards,
Min Wei

XMC4200 Actuator kit virtual com

$
0
0
Hello.

In the schematics for the XMC4200 actuator kit (and the literature) it appears that it was intended that a CDC device would be exposed via the onboard jlink probe for host communication. On my device, this functionality appears to be absent (tested on both OSX and linux).

There does not appear to be a CDC interface present in the USB descriptor.

This board was provided to me by an apps engineer for the purpose of adding XMC4k series support to OpenOCD, so perhaps I got a pre-production board?

Any help would be appreciated, even if it's just to tell me that this functionality is broken so I don't waste any more time on it.

Thanks.
Jeff
Viewing all 9892 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>