- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry,
My English is poor,look at the picture
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please don't create a new thread everytime, just add the picture here. Maybe you can just drag-and-drop it into the editor?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There was a bug IIRC that the debugger showed values in the watch windows only after execution of the line. So it might be that the first image (3.jgp) just shows the wrong value anyways, and only the second one is correct. I think Bob knows more about that...
Apart from that, there is a waring in Creator which affects how function calls during interrupts are handled (one method is not made re-entrant), maybe thats the issue?
(And the code in question is rather pointless and show be removed by the compiler anyway...)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just saw that you always show the same line in your screenshots. Are these from different runs of the project, or did you just stop multiple times and looked at the value? Like said before, I would expect the compile to optimize the line in question from the program altogether, so the value of the variable should never be touched.
Can you post your example project showing this behaviour? (Use the 'archive project' function of Creator).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just stop multiple times and looked at the value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can certainly this variable is not used anywhere in the remote.c
I try to add other variables
This phenomenon occurs only in the same address
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is a programming error:
slaveaddress = slaveaddress; is not what you want!
should look something like slaveaddress = slaveid;
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
But this was not the question. Why does the value of slaveaddress change when it is only assigned to itself?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So you had slaveaddress as target of a DMA process? How does this come to be? (It is something which could be found with a full text search over the whole project, btw. This is sometimes really helpful...)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I enable the DMA but it seems that there are some problems
The enable DMA would have been changed 02000000H (.map file) address value
Close DMA no longer occurs
I changed Enable DMA after an error occurs
(Thanks to google translation)
------------------------------------------------------------------------------------
#define DMA_BYTES_PER_BURST 2
#define DMA_REQUEST_PER_BURST 1
#define DMA_SRC_BASE (CYDEV_PERIPH_BASE)
#define DMA_DST_BASE (CYDEV_SRAM_BASE)
DMA_Chan = DMA_DmaInitialize(DMA_BYTES_PER_BURST, DMA_REQUEST_PER_BURST,
HI16(DMA_SRC_BASE), HI16(DMA_DST_BASE));
DMA_TD[0] = CyDmaTdAllocate();
CyDmaTdSetConfiguration(DMA_TD[0], 16, DMA_INVALID_TD, TD_TERMIN_EN | DMA__TD_TERMOUT_EN | TD_INC_DST_ADR);
CyDmaTdSetAddress(DMA_TD[0], LO16((uint32)ADCINC_DEC_SAMP_PTR), LO16((uint32)0));
CyDmaChSetInitialTd(DMA_Chan, DMA_TD[0]);
CyDmaChEnable(DMA_Chan, 1);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To Bob
[This is a programming error:
slaveaddress = slaveaddress; is not what you want!
should look something like slaveaddress = slaveid;]
Yes,slaveaddress = slaveaddress; is pointless
I just want to confirm that he should not be changed
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"The enable DMA would have been changed 02000000H (.map file) address value"
But 0x02000000 is the address of your slaveAddr variabl - look at the comment in your source file (the excerpt from the map file). It seems to be the first variable located in the sRAM, and the sRAM is the target base address for the DMA. And since you set the offset of the target to 0, you write to this variable...
The CyDmaTdSetAddress() call should set a proper address for the target - normally it should be the address of an array in RAM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
(I suspect you did not properly copy the DelSig-ADC example from the AppNote 🙂