MK60 can not transfer data to bidband address?

cancel
Showing results for 
Search instead for 
Did you mean: 

MK60 can not transfer data to bidband address?

254 Views
tim4146
Contributor I

As title say,I want to transfer test[]   (uint_32 test[4] = {0,1,0,1} ) to bitband to turn on and turn off a LED periodically .For example the bidband is GPIO PIN6 .

At first , I set the destiny address as another string ,like test2[]   (uint_32 test[4] ), also the offset is 4 .DMA transfered  successfully. and the dma interrupt is ok.

Then I changed the destiny address as bitband address,, offset is 0 .it seems that DMA can not work.

Code is saved in my office which can't be copied , or I will upload them .

I just confused that bidband area is a addrsss as usual, why 

So, do you know anything about DMA and bitband ?If you know ,please tell me .

Tags (3)
0 Kudos
3 Replies

76 Views
egoodii
Senior Contributor III

I assume first and foremost that you have confirmed your access thru the bitband-process to the single GPIO pin in question in direct code.

You don't make it clear what triggers what I have to assume are 'time sequenced' individual steps of DMA.  But in any case I should think we would need to see what your BitBand macro looks like.  The GPIO bitband can be accessed in two spaces on MK60, 0x400F_F000–0x400F_FFFF and 0x430F_F000–0x430F_FFFF.  DMA-master can only access the lower-path (Table 4-1).

0 Kudos

76 Views
tim4146
Contributor I

Finally ,I find the answer:"The bit-band alias is a virtual address range inside the Cortex-M3/M4 CPU only. The DMA can only reach the "normal" physical address of the GPIOs, but cannot do bit-banding."

0 Kudos

76 Views
tim4146
Contributor I

I feel sry about  what I said before was not that accurate.

My DMA trigger is FTM module,such as "FTM1_CH0_DMAREQ", which is OK when I want to copy a uint32 array to another ,here I define them as array A and array B.so ,the strigger is RIGHT.In fact ,I tried to use PIT+DMA but failed, PIT can only "trigger" dma one time. It seems to be a BUG in MK60.

OK ,then ,I changed the array B 's address with a bitband address. Here I want to talk about the bitband:

#define BITBAND_REG(Reg,Bit) (*((uint32_t volatile*)(0x42000000u + (32u*((uint32_t)&(Reg) - (uint32_t)0x40000000u)) + (4u*((uint32_t)(Bit))))))

#define PEout(n)   BITBAND_REG(PTE->PDOR, n)

When i use " PEout(n) = !PEout(n) " ,the PIN can be Toggled,and the LED can be turn on or turn off. In my Opinion, if an array like {0,1,0,1,0,1} transfer to the address,my LED should be turned periodically.

Here 0x42000000u + (32u*((uint32_t)&(Reg) - (uint32_t)0x40000000u)) + (4u*((uint32_t)(Bit))) is my bitband address.

What I want to express is that the trigger is correct, the bitband address is correct ,but DMA is dead....that make me confused.

Thx for ur communication, u r so helpful. If I have time ,I'll upload the screenshot. Indeed,I want to know whether the bitband can be operate by DMA or not.

0 Kudos