On Sat, Mar 28, 2020 at 5:04 PM Åke Rehnman <ake.rehn...@gmail.com> wrote: > > Hi Antonio, > > so I have made some tests on a stm8s105 + stlink v2 and as far as I can see > it works without problems. The only annoyance were all these debug print outs > but you saw that comment in gerrit. The "stlink_cmd_allow_retry > ERROR_WAIT..." is another source of garbage in the debug logs...
Hi Åke, added the list in copy. Good, thanks for your tests. Agree, I have added some debug print not present in the mainline version, will remove them or replaced with LOG_DEBUG_IO. > The only concern I have is the headache with the adapter speed setting (which > you are not to be blamed). As you might have noticed the only setting in the > cfg file that works is the low speed (363kHz) and on top of that the stm8 > examine target function is hard coded to set the adapter speed to high... and > if one dare to change the adapter speed the adapter crashes. The original code for STM8 in OpenOCD ignores the speed set in the config file, so by default starts at low speed and later has hardcoded the switch to high speed. The new code take in consideration the speed in the config file. For the moment it only works if low speed is set and then used at attach. Then the code keep the old behaviour to switch to high speed later, ignoring what is specified in the config file. Agree, it's really crap, but this is what was implemented through reverse engineering of the protocol. I have some ST "internal" documentation, so I will try to fix it, but was not the purpose of this patch series. I need to study better how this story of the speed works and what exactly has to be done at attach and for target reset. > But this is perhaps another patch... Sure. Thanks, Antonio > /Ake > > On 2020-03-26 17:50, Åke Rehnman wrote: > > I tried compiling it for cygwin/newlib > > It seems for newlib useconds_t is typedef:ed to long... > > /Ake > > On 2020-03-26 13:44, Antonio Borneo wrote: > > Interesting... > > On which OS do you compile and with which version of compiler? > > Thanks > Antonio > > On Thu, Mar 26, 2020, 11:58 Åke Rehnman <ake.rehn...@gmail.com> wrote: >> >> Hi, >> >> I got an error but I have not looked in to it yet. >> >> /Ake >> >> In file included from ../src/jtag/jtag.h:26, >> from ../src/jtag/interface.h:28, >> from ../src/jtag/drivers/stlink_usb.c:35: >> ../src/jtag/drivers/stlink_usb.c: In function ‘stlink_cmd_allow_retry’: >> ../src/jtag/drivers/stlink_usb.c:839:14: error: format ‘%u’ expects >> argument of type ‘unsigned int’, but argument 7 has type ‘useconds_t’ >> {aka ‘long unsigned int’} [-Werror=format=] >> 839 | LOG_DEBUG("stlink_cmd_allow_retry ERROR_WAIT, retry %d, >> delaying %u microseconds", retries, delay_us); >> | >> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> ~~~~~~~~ >> | | >> | useconds_t {aka long unsigned int} >> ../src/helper/log.h:123:5: note: in definition of macro ‘LOG_DEBUG’ >> 123 | expr); \ >> | ^~~~ >> ../src/jtag/drivers/stlink_usb.c:839:70: note: format string is defined here >> 839 | LOG_DEBUG("stlink_cmd_allow_retry ERROR_WAIT, retry %d, >> delaying %u microseconds", retries, delay_us); >> | ~^ >> | | >> | unsigned int >> | %lu >> cc1: all warnings being treated as errors >> >> >> On 2020-03-26 10:20, Antonio Borneo wrote: >> > On Thu, Mar 26, 2020 at 8:57 AM Åke Rehnman <ake.rehn...@gmail.com> wrote: >> >> Hello Antonio, >> >> >> >> did you test any of this on real hardware? >> >> >> > Hello Åke, >> > >> > yes, I have used a nucleo board MB1344C with STM8L152R8 >> > http://www.st.com/stm8nucleo >> > Then the following command >> > openocd -f interface/stlink-dap.cfg -f target/stm8l152.cfg >> > Do not use anymore the HLA interface stlink.cfg, but the new stlink-dap.cfg >> > Maybe I should add the board files ... >> > >> > Best Regards >> > Antonio >> > >> >> BR >> >> >> >> /Ake >> >> >> >> On 2020-03-23 15:49, Antonio Borneo (Code Review) wrote: >> >>> Antonio Borneo has posted comments on this change. ( >> >>> http://openocd.zylin.com/5528 ) >> >>> >> >>> Change subject: swim: abstract the transport in stm8 target >> >>> ...................................................................... >> >>> >> >>> >> >>> Patch Set 2: Code-Review+1 >> >>> _______________________________________________ OpenOCD-devel mailing list OpenOCD-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openocd-devel