DAVE™ Forum Discussions
DAVE™
I am using 4 synchronously sampled VADC channels @ 1.25 Msps transferred to 4 circular buffers using GPDMA0.In the DMA interrupt (block transfer compl...
Show More
I am using 4 synchronously sampled VADC channels @ 1.25 Msps transferred to 4 circular buffers using GPDMA0.
In the DMA interrupt (block transfer complete = inner loop) the GPDMA0_CHx->DAR is pointed to the next buffer window, GPDMA0->MASKBLOCK, GPDMA0->CHENREG and GPDMA0->CLEARBLOCK are set to enable the next transfer.
In an outer loop I check for new windows and do an evaluation of the buffer content. If the window content has a given frequency content the channel should be suspended. What is the correct procedure using the DMA003/NVIC_DMA001 apps or direct register control? When all channels are suspended, the inner loop shold stop (DMA IRQ). Should I reset GPDMA0->DMACFGREG.DMA_EN, or is there another way?.
At a later time (after some more data processing etc.) I wish to restart the DMA, enable all channels and restart transfer. Correct procedure at this point?
I have tried a lot of different stuff so far, but even if I am able to stop the individual channels (by not setting the corresponding CHENREG and MASKBLOCK bits), I later have problems when trying to restart them.
Thanks,
/Åse Maj Show Less
In the DMA interrupt (block transfer complete = inner loop) the GPDMA0_CHx->DAR is pointed to the next buffer window, GPDMA0->MASKBLOCK, GPDMA0->CHENREG and GPDMA0->CLEARBLOCK are set to enable the next transfer.
In an outer loop I check for new windows and do an evaluation of the buffer content. If the window content has a given frequency content the channel should be suspended. What is the correct procedure using the DMA003/NVIC_DMA001 apps or direct register control? When all channels are suspended, the inner loop shold stop (DMA IRQ). Should I reset GPDMA0->DMACFGREG.DMA_EN, or is there another way?.
At a later time (after some more data processing etc.) I wish to restart the DMA, enable all channels and restart transfer. Correct procedure at this point?
I have tried a lot of different stuff so far, but even if I am able to stop the individual channels (by not setting the corresponding CHENREG and MASKBLOCK bits), I later have problems when trying to restart them.
Thanks,
/Åse Maj Show Less
DAVE™
Hi,We have project with approximately 80 apps. We share this project in CVS. Question is which files is necessary to share in CVS?Is it necessary to s...
Show More
Hi,
We have project with approximately 80 apps. We share this project in CVS. Question is which files is necessary to share in CVS?
Is it necessary to storage all files in all folders and subfolders?
Note: Our project actualy contain 1382 files, 417 folders 😞
Any advice?
Best regards
Koumak Show Less
We have project with approximately 80 apps. We share this project in CVS. Question is which files is necessary to share in CVS?
Is it necessary to storage all files in all folders and subfolders?
Note: Our project actualy contain 1382 files, 417 folders 😞
Any advice?
Best regards
Koumak Show Less
DAVE™
Hi there,I´m trying to create some code where is used SPI to communicate with booths ISOFACE ( IN and OUT) and use CANBUS too.But I have some problem...
Show More
Hi there,
I´m trying to create some code where is used SPI to communicate with booths ISOFACE ( IN and OUT) and use CANBUS too.
But I have some problems here.
1º If I use only the routine to communicate with ISOFACE OUT the code runs well. But when I put the code to ISOFACE IN the routine of ISOFACE OUT stops with status "Timeout".
I green on this.
This is my code.... Can anyone tell me what's can cause that or what can be done to fix this?
/*
* Main.c
*
* Created on: 8 de Fev de 2014
* Author: Luis
*/
#include //Declarations from DAVE3 Code Generation (includes SFR declaration)
/* Thread IDs */
osThreadId tid_thread0; /* assigned ID for thread 1 */
osThreadId tid_thread1; /* assigned ID for thread 1 */
osThreadId tid_thread2; /* assigned ID for thread 2 */
osSemaphoreDef(TestSem);
osSemaphoreId Sem;
int32_t timer1;
int32_t timer2;
uint8_t Readdata[256];
uint8_t ReadpageCmd[4];
void osTimer_thread(void const *argument);
void t1_thread(void const *argument);
void t2_thread(void const *argument);
void Write_Isoface(uint16_t data);
uint16_t Read_Isoface();
void Timer_10ms_CallBack(void const *arg);
void Timer_100ms_CallBack(void const *arg);
osTimerDef(Timer1, Timer_10ms_CallBack);
osTimerDef(Timer2, Timer_100ms_CallBack);
uint32_t exec1, exec2;
SPI002_ChConfigType Channel_wrData =
{
.Direction = SPI002_SRC_CHANNEL,
.Mode = SPI002_CH_STANDARD,
.DataCount = 1,
.DummyData = 0xFFFF
};
SPI002_ChConfigType Channel_dummy_Data =
{
.Direction = SPI002_SRC_CHANNEL,
.Mode = SPI002_CH_STANDARD,
.DataCount = 1,
.DummyData = 0xFFFF
};
SPI002_ChConfigType Channel_ReadpageCmd =
{
.Direction = SPI002_SRC_CHANNEL,
.Mode = SPI002_CH_STANDARD,
.DataCount = 4,
.DummyData = 0xFFFF
};
SPI002_ChConfigType Channel_Readpage =
{
.Direction = SPI002_DEST_CHANNEL,
.Mode = SPI002_CH_STANDARD,
.DataCount = 256,
.DummyData = 0xFFFF
};
osThreadDef(osTimer_thread, osPriorityNormal, 1, 0);
osThreadDef(t1_thread, osPriorityNormal, 1, 0);
osThreadDef(t2_thread, osPriorityNormal, 1, 0);
/*----------------------------------------------------------------------------
* Thread 1: Send thread
*---------------------------------------------------------------------------*/
void t1_thread(void const *argument) {
for (;;) {
osDelay(100);
IO004_TogglePin(IO004_Handle0);
Read_Isoface();
}
/* We are done here, exit this thread */
}
/*----------------------------------------------------------------------------
* Thread 2: Receive thread
*---------------------------------------------------------------------------*/
void t2_thread(void const *argument) {
status_t status;
Write_Isoface(0);
Readdata[0]=0x55;
Readdata[1]=0xAA;
for (;;) {
Write_Isoface((uint16_t)Readdata[0]);
osDelay(100);
Write_Isoface((uint16_t)Readdata[1]);
osDelay(100);
}
}
/*----------------------------------------------------------------------------
* T Timer_10ms_CallBack
*---------------------------------------------------------------------------*/
void osTimer_thread(void const *argument) {
osTimerId id1, id2;
osStatus status;
uint32_t timerDelay;
exec1 = 1;
exec2 = 2;
id1 = osTimerCreate(osTimer(Timer1), osTimerPeriodic, &exec1);
if (id1) {
timerDelay = 50;
status = osTimerStart(id1, timerDelay); // start timer
if (status != osOK) {
// Timer could not be started
}
}
id2 = osTimerCreate(osTimer(Timer2), osTimerPeriodic, &exec2);
if (id2) {
timerDelay = 100;
status = osTimerStart(id2, timerDelay); // start timer
if (status != osOK) {
// Timer could not be started
}
}
}
/*----------------------------------------------------------------------------
* T Timer_10ms_CallBack
*---------------------------------------------------------------------------*/
void Timer_10ms_CallBack(void const *arg) {
timer1++;
}
/*----------------------------------------------------------------------------
* Timer_100ms_CallBack
*---------------------------------------------------------------------------*/
void Timer_100ms_CallBack(void const *arg) {
timer2++;
}
/*----------------------------------------------------------------------------
* Main
*---------------------------------------------------------------------------*/
int main(void)
{
// status_t status; // Declaration of return variable for DAVE3 APIs (toggle comment if required)
DAVE_Init(); // Initialization of DAVE Apps
tid_thread0 = osThreadCreate(osThread(osTimer_thread), NULL);
tid_thread1 = osThreadCreate(osThread(t1_thread), NULL);
tid_thread2 = osThreadCreate(osThread(t2_thread), NULL);
osKernelStart();
osDelay(osWaitForever);
while(1)
{
}
return 0;
}
uint16_t Read_Isoface() {
volatile uint32_t Status;
SPI002_JobConfigType JobHandle;
Channel_Readpage.ChDataPtr = (uint16_t*)&Readdata;
SPI002_LocalStructureInit(&SPI002_Handle0,SPI002_JOB2,&JobHandle,56);
ReadpageCmd[0]=0xFF;
SPI002_SetupChannel(&JobHandle,SPI002_JOB_CH1,&Channel_ReadpageCmd);
SPI002_SetupChannel(&JobHandle,SPI002_JOB_CH2,&Channel_Readpage);
JobHandle.FrameLen = 8;
SPI002_StartJob(&JobHandle,500);
Status = SPI002_WaitForJobCompletion(&JobHandle,500);
if(Status != DAVEApp_SUCCESS)
while(1);
Status = SPI002_GetJobStatus(&JobHandle);
if(Status != SPI002_JOB_OK )
while(1);
}
void Write_Isoface(uint16_t Data) {
volatile uint32_t Status;
uint16_t Write;
SPI002_JobConfigType JobHandle;
Write=Data;
Channel_wrData.ChDataPtr = (uint16_t*)&Write;
SPI002_LocalStructureInit(&SPI002_Handle0,SPI002_JOB1,&JobHandle,55);
/* This job sends 0x55 to the ISOFACE LEDs */
SPI002_SetupChannel(&JobHandle,SPI002_JOB_CH1,&Channel_wrData);
JobHandle.FrameLen = 8;
JobHandle.WordLen=8;
SPI002_StartJob(&JobHandle,500);
Status = SPI002_WaitForJobCompletion(&JobHandle,500);
if(Status != DAVEApp_SUCCESS)
while(1);
Status = SPI002_GetJobStatus(&JobHandle);
if(Status != SPI002_JOB_OK )
while(1);
}
Regards
Luis Silva
Show Less
I´m trying to create some code where is used SPI to communicate with booths ISOFACE ( IN and OUT) and use CANBUS too.
But I have some problems here.
1º If I use only the routine to communicate with ISOFACE OUT the code runs well. But when I put the code to ISOFACE IN the routine of ISOFACE OUT stops with status "Timeout".
I green on this.
This is my code.... Can anyone tell me what's can cause that or what can be done to fix this?
/*
* Main.c
*
* Created on: 8 de Fev de 2014
* Author: Luis
*/
#include
/* Thread IDs */
osThreadId tid_thread0; /* assigned ID for thread 1 */
osThreadId tid_thread1; /* assigned ID for thread 1 */
osThreadId tid_thread2; /* assigned ID for thread 2 */
osSemaphoreDef(TestSem);
osSemaphoreId Sem;
int32_t timer1;
int32_t timer2;
uint8_t Readdata[256];
uint8_t ReadpageCmd[4];
void osTimer_thread(void const *argument);
void t1_thread(void const *argument);
void t2_thread(void const *argument);
void Write_Isoface(uint16_t data);
uint16_t Read_Isoface();
void Timer_10ms_CallBack(void const *arg);
void Timer_100ms_CallBack(void const *arg);
osTimerDef(Timer1, Timer_10ms_CallBack);
osTimerDef(Timer2, Timer_100ms_CallBack);
uint32_t exec1, exec2;
SPI002_ChConfigType Channel_wrData =
{
.Direction = SPI002_SRC_CHANNEL,
.Mode = SPI002_CH_STANDARD,
.DataCount = 1,
.DummyData = 0xFFFF
};
SPI002_ChConfigType Channel_dummy_Data =
{
.Direction = SPI002_SRC_CHANNEL,
.Mode = SPI002_CH_STANDARD,
.DataCount = 1,
.DummyData = 0xFFFF
};
SPI002_ChConfigType Channel_ReadpageCmd =
{
.Direction = SPI002_SRC_CHANNEL,
.Mode = SPI002_CH_STANDARD,
.DataCount = 4,
.DummyData = 0xFFFF
};
SPI002_ChConfigType Channel_Readpage =
{
.Direction = SPI002_DEST_CHANNEL,
.Mode = SPI002_CH_STANDARD,
.DataCount = 256,
.DummyData = 0xFFFF
};
osThreadDef(osTimer_thread, osPriorityNormal, 1, 0);
osThreadDef(t1_thread, osPriorityNormal, 1, 0);
osThreadDef(t2_thread, osPriorityNormal, 1, 0);
/*----------------------------------------------------------------------------
* Thread 1: Send thread
*---------------------------------------------------------------------------*/
void t1_thread(void const *argument) {
for (;;) {
osDelay(100);
IO004_TogglePin(IO004_Handle0);
Read_Isoface();
}
/* We are done here, exit this thread */
}
/*----------------------------------------------------------------------------
* Thread 2: Receive thread
*---------------------------------------------------------------------------*/
void t2_thread(void const *argument) {
status_t status;
Write_Isoface(0);
Readdata[0]=0x55;
Readdata[1]=0xAA;
for (;;) {
Write_Isoface((uint16_t)Readdata[0]);
osDelay(100);
Write_Isoface((uint16_t)Readdata[1]);
osDelay(100);
}
}
/*----------------------------------------------------------------------------
* T Timer_10ms_CallBack
*---------------------------------------------------------------------------*/
void osTimer_thread(void const *argument) {
osTimerId id1, id2;
osStatus status;
uint32_t timerDelay;
exec1 = 1;
exec2 = 2;
id1 = osTimerCreate(osTimer(Timer1), osTimerPeriodic, &exec1);
if (id1) {
timerDelay = 50;
status = osTimerStart(id1, timerDelay); // start timer
if (status != osOK) {
// Timer could not be started
}
}
id2 = osTimerCreate(osTimer(Timer2), osTimerPeriodic, &exec2);
if (id2) {
timerDelay = 100;
status = osTimerStart(id2, timerDelay); // start timer
if (status != osOK) {
// Timer could not be started
}
}
}
/*----------------------------------------------------------------------------
* T Timer_10ms_CallBack
*---------------------------------------------------------------------------*/
void Timer_10ms_CallBack(void const *arg) {
timer1++;
}
/*----------------------------------------------------------------------------
* Timer_100ms_CallBack
*---------------------------------------------------------------------------*/
void Timer_100ms_CallBack(void const *arg) {
timer2++;
}
/*----------------------------------------------------------------------------
* Main
*---------------------------------------------------------------------------*/
int main(void)
{
// status_t status; // Declaration of return variable for DAVE3 APIs (toggle comment if required)
DAVE_Init(); // Initialization of DAVE Apps
tid_thread0 = osThreadCreate(osThread(osTimer_thread), NULL);
tid_thread1 = osThreadCreate(osThread(t1_thread), NULL);
tid_thread2 = osThreadCreate(osThread(t2_thread), NULL);
osKernelStart();
osDelay(osWaitForever);
while(1)
{
}
return 0;
}
uint16_t Read_Isoface() {
volatile uint32_t Status;
SPI002_JobConfigType JobHandle;
Channel_Readpage.ChDataPtr = (uint16_t*)&Readdata;
SPI002_LocalStructureInit(&SPI002_Handle0,SPI002_JOB2,&JobHandle,56);
ReadpageCmd[0]=0xFF;
SPI002_SetupChannel(&JobHandle,SPI002_JOB_CH1,&Channel_ReadpageCmd);
SPI002_SetupChannel(&JobHandle,SPI002_JOB_CH2,&Channel_Readpage);
JobHandle.FrameLen = 8;
SPI002_StartJob(&JobHandle,500);
Status = SPI002_WaitForJobCompletion(&JobHandle,500);
if(Status != DAVEApp_SUCCESS)
while(1);
Status = SPI002_GetJobStatus(&JobHandle);
if(Status != SPI002_JOB_OK )
while(1);
}
void Write_Isoface(uint16_t Data) {
volatile uint32_t Status;
uint16_t Write;
SPI002_JobConfigType JobHandle;
Write=Data;
Channel_wrData.ChDataPtr = (uint16_t*)&Write;
SPI002_LocalStructureInit(&SPI002_Handle0,SPI002_JOB1,&JobHandle,55);
/* This job sends 0x55 to the ISOFACE LEDs */
SPI002_SetupChannel(&JobHandle,SPI002_JOB_CH1,&Channel_wrData);
JobHandle.FrameLen = 8;
JobHandle.WordLen=8;
SPI002_StartJob(&JobHandle,500);
Status = SPI002_WaitForJobCompletion(&JobHandle,500);
if(Status != DAVEApp_SUCCESS)
while(1);
Status = SPI002_GetJobStatus(&JobHandle);
if(Status != SPI002_JOB_OK )
while(1);
}
Regards
Luis Silva
DAVE™
I was exploring the file Dave/Generated/src/WEBSERVER001/HTTPServer/httpd.h that contains the cgi and ssi handle methods for the webserver and i found...
Show More
I was exploring the file Dave/Generated/src/WEBSERVER001/HTTPServer/httpd.h that contains the cgi and ssi handle methods for the webserver and i found this define: LWIP_HTTPD_SUPPORT_POST.
Then I scrolled down and found some functions that could handle the post request, but don't quite underestand them. Can you please confirm if its possible to handle post requests and, if it is, give me some examples? Show Less
Then I scrolled down and found some functions that could handle the post request, but don't quite underestand them. Can you please confirm if its possible to handle post requests and, if it is, give me some examples? Show Less
DAVE™
He guys,how can I send "variable data" with all this const declaration?status_t USBVC001_SendByte(const uint8_t DataByte)status_t USBVC001_SendData(co...
Show More
He guys,
how can I send "variable data" with all this const declaration?
status_t USBVC001_SendByte(const uint8_t DataByte)
status_t USBVC001_SendData(const char* const DataBuffer, const uint16_t Length)
status_t USBVC001_SendString(const char* const DataString)
Maybe I'm wrong - but standard compiler does allow only constant and can send this into read only area.
Is there any sample - more than send a const "hello world" ?
Thanks for get me out of this gap. Show Less
how can I send "variable data" with all this const declaration?
status_t USBVC001_SendByte(const uint8_t DataByte)
status_t USBVC001_SendData(const char* const DataBuffer, const uint16_t Length)
status_t USBVC001_SendString(const char* const DataString)
Maybe I'm wrong - but standard compiler does allow only constant and can send this into read only area.
Is there any sample - more than send a const "hello world" ?
Thanks for get me out of this gap. Show Less
DAVE™
Hi, can anyone advise how to map a potential value using XMC1300 dave apps.For example 5V. I would like to map it to value 0 to 100.If my potential vo...
Show More
Hi, can anyone advise how to map a potential value using XMC1300 dave apps.
For example 5V. I would like to map it to value 0 to 100.
If my potential volue is 2.5V, my output value should gives 50.
I'm not sure do i need to use ADC?
Can i read my voltage value using IO001 [1.0.12] with the coding below?:
#include
int main(void)
{
bool Value = 0;
DAVE_Init(); // IO001_Init() is called within DAVE_Init()
Value = IO001_ReadPin(IO001_Handle0);
return 0;
}
I could not get any value with the coding above
Show Less
For example 5V. I would like to map it to value 0 to 100.
If my potential volue is 2.5V, my output value should gives 50.
I'm not sure do i need to use ADC?
Can i read my voltage value using IO001 [1.0.12] with the coding below?:
#include
int main(void)
{
bool Value = 0;
DAVE_Init(); // IO001_Init() is called within DAVE_Init()
Value = IO001_ReadPin(IO001_Handle0);
return 0;
}
I could not get any value with the coding above
DAVE™
Hi,To implement the CANOPEN I need reconfigure the identifier in the transmission messages.I try to change the "CAN001_MessageHandle0_2.Identifier=0x1...
Show More
Hi,
To implement the CANOPEN I need reconfigure the identifier in the transmission messages.
I try to change the "CAN001_MessageHandle0_2.Identifier=0x180" but it do not work. The message goes with the base ID for that LMO
How can i do it?
I want to use only 1 LMO to receive all messages and 1 LMO to transmit, but i need to change the messages identifier.
I tried this
i configured the LMO_1 to receive and for transmit LMO_2.
TempMsgHandle.Identifier = 0x180
TempMsgHandle.DataLength = 4;
TempMsgHandle.data[0] = (uint8_t) adc_Res.Result;
TempMsgHandle.data[1] = (uint8_t) (adc_Res.Result >> 8);
TempMsgHandle.data[2] = (uint8_t) (adc_Res.Result >> 16);
TempMsgHandle.data[3] = (uint8_t) (adc_Res.Result >> 24);
CAN001_MessageHandle0_2.Identifier=0x180;
status = CAN001_ConfigMsgObj(&CAN001_Handle0, &TempMsgHandle, 2);
status=CAN001_UpdateMODataRegisters(&CAN001_Handle0, 2, TempMsgHandle.DataLength, TempMsgHandle.data);
status = CAN001_SendDataFrame(&CAN001_Handle0, 2);
It doesn´t work 😞
Can anyone help me with this?
Luis Silva Show Less
To implement the CANOPEN I need reconfigure the identifier in the transmission messages.
I try to change the "CAN001_MessageHandle0_2.Identifier=0x180" but it do not work. The message goes with the base ID for that LMO
How can i do it?
I want to use only 1 LMO to receive all messages and 1 LMO to transmit, but i need to change the messages identifier.
I tried this
i configured the LMO_1 to receive and for transmit LMO_2.
TempMsgHandle.Identifier = 0x180
TempMsgHandle.DataLength = 4;
TempMsgHandle.data[0] = (uint8_t) adc_Res.Result;
TempMsgHandle.data[1] = (uint8_t) (adc_Res.Result >> 8);
TempMsgHandle.data[2] = (uint8_t) (adc_Res.Result >> 16);
TempMsgHandle.data[3] = (uint8_t) (adc_Res.Result >> 24);
CAN001_MessageHandle0_2.Identifier=0x180;
status = CAN001_ConfigMsgObj(&CAN001_Handle0, &TempMsgHandle, 2);
status=CAN001_UpdateMODataRegisters(&CAN001_Handle0, 2, TempMsgHandle.DataLength, TempMsgHandle.data);
status = CAN001_SendDataFrame(&CAN001_Handle0, 2);
It doesn´t work 😞
Can anyone help me with this?
Luis Silva Show Less
DAVE™
By add the App "CAN001 [1.0.8]" to my project,i got the error "Unhandled event loop exception" "java.lang.StackOverflowError"and i have to close Dav...
Show More
By add the App "CAN001 [1.0.8]" to my project,
i got the error
"Unhandled event loop exception"
"java.lang.StackOverflowError"
and i have to close Dave.
After restarting Dave, i could add the CAN-App.
What is the problem? Show Less
i got the error
"Unhandled event loop exception"
"java.lang.StackOverflowError"
and i have to close Dave.
After restarting Dave, i could add the CAN-App.
What is the problem? Show Less
DAVE™
If i try to add a app to my Project,i got an error: "Resource Management" "HW resources not sharable constraint, Please check, if the device ha...
Show More
If i try to add a app to my Project,
i got an error:
"Resource Management"
"HW resources not sharable constraint, Please check, if
the device has enough resources"
Is it possible to see, on which resource the conflict occurs? Show Less
i got an error:
"Resource Management"
"HW resources not sharable constraint, Please check, if
the device has enough resources"
Is it possible to see, on which resource the conflict occurs? Show Less
DAVE™
Hi I am new to XMC4400 and I have just get started with hexagon kit.and I have just started debugging with xSPY. I am facing two problems:(1) In xSPY ...
Show More
Hi
I am new to XMC4400 and I have just get started with hexagon kit.
and I have just started debugging with xSPY. I am facing two problems:
(1) In xSPY control page, when I use "Control field", I am able to locate xSPY variables "Name" but the "GroupID" is not showing in the list In xSPY property sheet (Works/updates fine when "Get (All)" button is pressed).
(2) In case of Oscilloscope config, I am not getting any (Name or GroupID) in the property list. Therefore, I am not able to use oscilloscope functionality.
Any help will be appreciated... Show Less
I am new to XMC4400 and I have just get started with hexagon kit.
and I have just started debugging with xSPY. I am facing two problems:
(1) In xSPY control page, when I use "Control field", I am able to locate xSPY variables "Name" but the "GroupID" is not showing in the list In xSPY property sheet (Works/updates fine when "Get (All)" button is pressed).
(2) In case of Oscilloscope config, I am not getting any (Name or GroupID) in the property list. Therefore, I am not able to use oscilloscope functionality.
Any help will be appreciated... Show Less