Hi Warren,
I don't know all the details about your development and the study you are
doing, I have read something fast, and I may say something that is obvious
to you, but that costed me a bit of time... so, what I'd like to tell you
is to take care about how the different arm architectures treat the
unaligned accesses to memory (LDR, STR ).
While architecture v7 does NOT give an hard fault for unaligned accesses if
there is no UNALIGN_TRAP bit active in the CCR register, v6m (and I guess
v6) will always give a core generated hard fault.
This means that if you have a message stored in your memory and you think
you may, as an example, access the payload of the message with 32-bit word
alignment, you should take care that your payload is really 32-bit word
aligned in the case of cortex M0 and M0+ or access it with byte alignment,
while for M3 and M4 that should not really matter if the trap bit is 0
(usually it's default to 0, but it's up to the chip designer to set this...
so better check it out).
Hope this helps,
Angelo.
2017-03-14 15:14 GMT+01:00 Warren Gay <ve3...@gmail.com>:
> Earlier I posted to the list about my attempt to use the f107 usb driver
> on the stm32f103c8t6 MCU, which turned out to be inappropriate (no OTG
> support for f103).
>
> I later discovered an example using the st_usbfs_v1 driver. Using that, I
> was able to get a modified USB CDC demo going, and later even under
> FreeRTOS as well. The name of this driver (with "fs" in it) originally
> caused me to doubt that I could use it for this purpose. But it seems to
> work just fine as a polled driver. Within FreeRTOS, you just have to run
> everything USB driver related from one thread.
>
> My present question for the list:
>
> *What is the difference between st_usbfs_v1.c and st_usbfs_v2.c? *
>
> Based upon a diff and comments, it would appear that v2 was created to
> deal with limitations of the Cortex-M0 unaligned copies (bytewise copies vs
> words). Is that entirely it? I just want to verify that the v1 driver is my
> best choice for the f103 (without forced alignment enabled).
>
> Thanks, Warren
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> libopencm3-devel mailing list
> libopencm3-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libopencm3-devel
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
libopencm3-devel mailing list
libopencm3-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libopencm3-devel