|
From: Maximin C. <max...@gm...> - 2022-08-22 09:46:31
|
Hi all,
Thanks for the kind answer ! I just opened the bcm2835 driver code, and I
don't
even understand the read/write functions:
static int bcm2835gpio_swd_write(int swclk, int swdio)
{
uint32_t set = swclk << swclk_gpio | swdio << swdio_gpio;
uint32_t clear = !swclk << swclk_gpio | !swdio << swdio_gpio;
GPIO_SET = set;
GPIO_CLR = clear;
for (unsigned int i = 0; i < jtag_delay; i++)
asm volatile ("");
return ERROR_OK;
}
Is it just me, or this function does absolutely nothing ?
I am quite lost here...
Best regards,
--
Maximin COSTE
Le jeu. 28 juil. 2022 à 22:56, Benjamin Henrion <zo...@gm...> a écrit :
> Le jeu. 28 juil. 2022 à 16:14, Maximin COSTE <max...@gm...> a
> écrit :
>
>> Hi,
>>
>> >Sysfs is slow (and deprecated by the kernel guys), gpiod is way faster.
>>
>> Surprisingly, the flash duration is the same (+/1 sec) for gpiod and
>> sysfs here !
>>
>> >I think there is a gpiod cable in openocd now, but i have not tested it
>> yet.
>>
>> My apologies if this is a stupid but what is a "cable" in this context ?
>> I use gpiod in my configuration file using the following adapter command:
>> "adapter driver linuxgpiod"
>>
>
> Adapter sorry, cable is for urjtag :-)
>
>
>> Best regards,
>>
>> --
>> Maximin COSTE
>>
>>
>> Le jeu. 28 juil. 2022 à 16:06, Benjamin Henrion <zo...@gm...> a
>> écrit :
>>
>>> Le jeu. 28 juil. 2022 à 14:42, Maximin COSTE <max...@gm...> a
>>> écrit :
>>>
>>>> Hi everybody,
>>>>
>>>> I was previously using openocd on a RPI Zero 1/2 to flash an STM32F412
>>>> using SWD protocol.
>>>> The whole flashing operation takes around 5 to 6 seconds which is fine.
>>>> My only constraint is that operation takes no more than those 5 to 6
>>>> seconds (it is
>>>> because the STM32F4 sends keep-alive frames via CAN to the main
>>>> battery. If there is
>>>> no message received in the last ~7 sec, the battery shutdown and so
>>>> does the entiere
>>>> system).
>>>>
>>>> Due to the current shortage of RPI boards, I switched to Radxa Pi Zero
>>>> (https://wiki.radxa.com/Zero) with an AMLogic S905Y2 inside.
>>>> I have tried to use sysfs and gpiod (in my understanding, there are
>>>> pretty much the
>>>> same thing, and gpiod is newer ?) and despite thoses errors messages:
>>>>
>>>
>>> Sysfs is slow (and deprecated by the kernel guys), gpiod is way faster.
>>>
>>>
>>>> > Error: Translation from khz to adapter speed not implemented
>>>> (maybe it is because of the use of such "generic" layer)
>>>>
>>>> > Error executing event reset-start on target stm32f4x.cpu:
>>>> (here I am not sure what is going on...)
>>>>
>>>> it goes to the end, and flash is "correctly" done !
>>>>
>>>> My only (but big !) concern is that with sysfs or gpiod, the flashing
>>>> process takes around
>>>> 9-10sec and as specified in the beginning of this message, this is too
>>>> much, and
>>>> the system battery goes timeout with this duration...
>>>>
>>>> It is my understanding that the BCM2835gpio driver for OpenOCD uses
>>>> specific directs
>>>> RAM access to achieve the speed I mesured in my usage (5-6 seconds).
>>>> It looks like nothing comparable is available for AMLogic S905Y2/ Radxa
>>>> Pi ?
>>>> I might have no searched deep enough, or in the right place.
>>>> If nothing is available, how do you see this ? Should it be straight
>>>> forward to
>>>> implement ? Can I get at least the same performances I had with the
>>>> BCM2835gpio driver ?
>>>>
>>>
>>> I think there is a gpiod cable in openocd now, but i have not tested it
>>> yet.
>>>
>>> Best,
>>>
>>>
>>>
>>>> Best regards,
>>>>
>>>> --
>>>> Maximin COSTE
>>>> _______________________________________________
>>>> OpenOCD-user mailing list
>>>> Ope...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/openocd-user
>>>>
>>> _______________________________________________
>> OpenOCD-user mailing list
>> Ope...@li...
>> https://lists.sourceforge.net/lists/listinfo/openocd-user
>>
>
|