Jun 27, 2020
08:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 27, 2020
08:37 AM
Hello,
i'm using TC275,
i'm using DMA to copy code from PFlash0 to PSPR. i noticed that DMA was not able to overwrite a memory region in which exists already some code. is it normal or i need to do some config to permit the overwrite.
below a part of code that i'm using, the DMA was not able to copy m() [ located at 0x80008800 ] to 0x701001b0 in which there is already f() code.
i compiled f() and m() with -mcode-pic option.
// f()
RESETANDSTARTPERFCOUNTER0(IfxCpu_CounterMode_normal);
SRC_DST_SIZE_SPEC0((uint32)0x80003800 ,(uint32) 0x701001b0 ,(uint16)40);
dma_transfer_launch0();
fperf = IfxCpu_stopCounters();
f_DMA_cycles = fperf.clock.counter;
RESETANDSTARTPERFCOUNTER0(IfxCpu_CounterMode_normal);
((functiontype0)0xC00001b0)();
fperf = IfxCpu_stopCounters();
f_cycles = fperf.clock.counter;
// m()
RESETANDSTARTPERFCOUNTER0(IfxCpu_CounterMode_normal);
SRC_DST_SIZE_SPEC0((uint32)0x80008800 ,(uint32) 0x701001b0 ,(uint16)8);
dma_transfer_launch0();
fperf = IfxCpu_stopCounters();
m_DMA_cycles = fperf.clock.counter;
RESETANDSTARTPERFCOUNTER0(IfxCpu_CounterMode_normal);
((functiontype0)0xC00001b0)();
fperf = IfxCpu_stopCounters();
m_cycles = fperf.clock.counter;
Thank you
i'm using TC275,
i'm using DMA to copy code from PFlash0 to PSPR. i noticed that DMA was not able to overwrite a memory region in which exists already some code. is it normal or i need to do some config to permit the overwrite.
below a part of code that i'm using, the DMA was not able to copy m() [ located at 0x80008800 ] to 0x701001b0 in which there is already f() code.
i compiled f() and m() with -mcode-pic option.
// f()
RESETANDSTARTPERFCOUNTER0(IfxCpu_CounterMode_normal);
SRC_DST_SIZE_SPEC0((uint32)0x80003800 ,(uint32) 0x701001b0 ,(uint16)40);
dma_transfer_launch0();
fperf = IfxCpu_stopCounters();
f_DMA_cycles = fperf.clock.counter;
RESETANDSTARTPERFCOUNTER0(IfxCpu_CounterMode_normal);
((functiontype0)0xC00001b0)();
fperf = IfxCpu_stopCounters();
f_cycles = fperf.clock.counter;
// m()
RESETANDSTARTPERFCOUNTER0(IfxCpu_CounterMode_normal);
SRC_DST_SIZE_SPEC0((uint32)0x80008800 ,(uint32) 0x701001b0 ,(uint16)8);
dma_transfer_launch0();
fperf = IfxCpu_stopCounters();
m_DMA_cycles = fperf.clock.counter;
RESETANDSTARTPERFCOUNTER0(IfxCpu_CounterMode_normal);
((functiontype0)0xC00001b0)();
fperf = IfxCpu_stopCounters();
m_cycles = fperf.clock.counter;
Thank you
1 Reply
Jun 30, 2020
01:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 30, 2020
01:12 AM
There is no limitation to do this except that your software configure any memory protection which don't allow the copy.
The code above will be work only on CPU0 because the call to function is to a local address.
Is there any error message from the DMA? DAM is triggered correct?
The code above will be work only on CPU0 because the call to function is to a local address.
Is there any error message from the DMA? DAM is triggered correct?