Re: STM32 a nastavení lock-bitu pres OpenOCD

Pavel KREJCI krepa76 na gmail.com
Středa Listopad 5 21:30:34 CET 2014


Mel ho tam!

Dne 5. listopadu 2014 20:44 Andrej Jancura <aj.hwlist na gmail.com> napsal(a):

> Tak mi to nedalo tiez a pozrel som to na 17´´... Hadajte co vyslo... :)))
>
>
> 2014-11-05 20:41 GMT+01:00 Jaroslav Buchta <jaroslav.buchta na hascomp.cz>:
>
>>  Asi nejaka starsi verze LCD s malym rozlisenim ;-) sry, nedalo mi to ;-)
>> A proc by to melo byt ujete? Pripada mi to prehledne, delsi zapis IMHO
>> nijak nevadi. Je to navic inicializace 2 DMA kanalu + jednoho preruseni,
>> jak jsem to namatkou vykopiroval ze zdrojaku.
>>
>>
>> Dne 5. 11. 2014 20:36, Andrej Jancura napsal(a):
>>
>>  No nech to je logicke ako chce, ja ten kod na svojom netbooku vidim na
>> troch obrazovkach... Nieco podobne ako doobeda prepinanie hodin.
>>
>>  Nezda sa Vam to trochu uletene?!
>>
>>  A.
>>
>> 2014-11-05 20:22 GMT+01:00 Jaroslav Buchta <jaroslav.buchta na hascomp.cz>:
>>
>>> Mozna, no, ale kdyz pouziju tu funkci, nemusim to resit ;-)
>>> Me prece jen napr. takovyto zapis prijde dost prehledny a elegantni, po
>>> prekladu a optimalizaci to neni ani nejak neefektivni.>
>>>
>>>     RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1, ENABLE);
>>>
>>>     DMA_InitTypeDef DMA_InitStructure;
>>>
>>>     DMA_StructInit(&DMA_InitStructure);
>>>     /* USART1_Rx_DMA_Channel (triggered by USART1 Rx event) Config */
>>>     DMA_DeInit(DMA1_Channel5);
>>>     DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)&(USART1->DR);
>>>     //USART1 DR
>>>     DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)mstRcvBuf;
>>>     DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralSRC;
>>>     DMA_InitStructure.DMA_BufferSize = MSTRCVBUFLEN;
>>>     DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
>>>     DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
>>>     DMA_InitStructure.DMA_PeripheralDataSize =
>>> DMA_PeripheralDataSize_Byte;
>>>     DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte;
>>>     DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;
>>>     DMA_InitStructure.DMA_Priority = DMA_Priority_High;
>>>     DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;
>>>     DMA_Init(DMA1_Channel5, &DMA_InitStructure);
>>>
>>>
>>>     DMA_StructInit(&DMA_InitStructure);
>>>     /* USART1_Tx_DMA_Channel (triggered by USART1 Tx event) Config */
>>>     DMA_DeInit(DMA1_Channel4);
>>>     DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)&(USART1->DR);
>>>     //USART1 DR
>>>     DMA_InitStructure.DMA_MemoryBaseAddr = (uint32_t)bufTxMaster;
>>>     DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralDST;
>>>     DMA_InitStructure.DMA_BufferSize = 1;
>>>     DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
>>>     DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
>>>     DMA_InitStructure.DMA_PeripheralDataSize =
>>> DMA_PeripheralDataSize_Byte;
>>>     DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte;
>>>     DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;
>>>     DMA_InitStructure.DMA_Priority = DMA_Priority_Medium;
>>>     DMA_InitStructure.DMA_M2M = DMA_M2M_Disable;
>>>     DMA_Init(DMA1_Channel4, &DMA_InitStructure);
>>>
>>>
>>>     NVIC_InitStructure.NVIC_IRQChannel = DMA1_Channel5_IRQn;
>>>     NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 14;
>>>     NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
>>>     NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
>>>     NVIC_Init(&NVIC_InitStructure);
>>>
>>>     DMA_ITConfig(DMA1_Channel5, DMA_IT_HT| DMA_IT_TC, ENABLE);
>>>
>>>      /* Enable USART1 DMA RX request */
>>>     USART_DMACmd(USART1, USART_DMAReq_Rx, ENABLE);
>>>     /* Enable USART1 DMA TX request */
>>>     USART_DMACmd(USART1, USART_DMAReq_Tx, ENABLE);
>>>
>>>     DMA_Cmd(DMA1_Channel5, ENABLE);
>>>
>>>
>>>
>>>
>>> Dne 5. 11. 2014 19:53, Jan Waclawek napsal(a):
>>>
>>>  Treba inicializace DMA je podstatne jednodussi naplnenim cca 15 polozek
>>>>> struktury dle nejakeho vzoroveho prikladu a pouzitim funkce ...Init,
>>>>> nez
>>>>> hledanim jake registry jak nastavit a v jakem poradi...
>>>>>
>>>> Zhodou okolnosti su to len 4 registre - zdojova adresa, cielova adresa,
>>>> pocet prenasanych poloziek a riadiaci register (plus treba vynulovat
>>>> status bity, t.j. spolu s tym je to 5) a v lubovolnom poradi, kym sa to
>>>> DMA nepovoli (tj najjednoduchsie je zapisovat do kontrolneho nakoniec,
>>>> inak je to jedno).
>>>>
>>>> S pozitim symbolov z stm32xxxx.h je to aj prehladne (akurat si treba
>>>> dopisat definicie poloziek pre bitove polia, KTORE BY SOM AJ NA TOMTO
>>>> MIESTE RAD POPROSIL OD PRITOMNYCH Z ST, ABY ICH DOPLNILI), napr.
>>>> www.efton.sk/STM32/bt.c spolu s www.efton.sk/STM32/stm32f4xx.h.zip
>>>>
>>>> wek
>>>>
>>>>
>>>> _______________________________________________
>>>> HW-list mailing list  -  sponsored by www.HW.cz
>>>> Hw-list na list.hw.cz
>>>> http://list.hw.cz/mailman/listinfo/hw-list
>>>>
>>>
>>>
>>>   ---
>>> This email is free from viruses and malware because avast! Antivirus
>>> protection is active.
>>> http://www.avast.com
>>>
>>>   _______________________________________________
>>> HW-list mailing list  -  sponsored by www.HW.cz
>>> Hw-list na list.hw.cz
>>> http://list.hw.cz/mailman/listinfo/hw-list
>>>
>>
>>
>>
>> _______________________________________________
>> HW-list mailing list  -  sponsored by www.HW.czHw-list na list.hw.czhttp://list.hw.cz/mailman/listinfo/hw-list
>>
>>
>>
>>
>> ------------------------------
>>    <http://www.avast.com/>
>>
>> This email is free from viruses and malware because avast! Antivirus
>> <http://www.avast.com/> protection is active.
>>
>>
>> _______________________________________________
>> HW-list mailing list  -  sponsored by www.HW.cz
>> Hw-list na list.hw.cz
>> http://list.hw.cz/mailman/listinfo/hw-list
>>
>>
>
> _______________________________________________
> HW-list mailing list  -  sponsored by www.HW.cz
> Hw-list na list.hw.cz
> http://list.hw.cz/mailman/listinfo/hw-list
>
>
------------- další část ---------------
HTML příloha byla odstraněna...
URL: <http://list.hw.cz/pipermail/hw-list/attachments/20141105/ef1d524f/attachment.html>


Další informace o konferenci Hw-list