cjheath / stm32f3-discovery-usb-example

The STM32F3-Discovery USB example, modified for compilation with GCC. This implements a USB Joystick using the accelerometers
16 stars 9 forks source link

Can not apply the patch #2

Open itsnewdroid opened 8 years ago

itsnewdroid commented 8 years ago

Can not understand where the patch needs to be. Tried different versions with no success. Can you help?

cjheath commented 8 years ago

You need to provide more information about what you have tried, what message you got, and what you think that means. I am unfortunately not psychic.

The STM32F3 peripherals library is code that you must download in a ZIP file from ST. The patch applies to its contents. I cannot redistribute the files due to their copyright notices. If you have this file and have unpacked the zip, you should be able to apply the patch. Have you tried this? What error did you get?

cjheath commented 8 years ago

When you unzip stm32f3discovery_fw.zip, you get a new directory called "STM32F3-Discovery_FW_V1.1.0". Before changing into that sub-directory, do "git clone git@github.com:cjheath/stm32f3-discovery-usb-example.git". That will give you a new subdirectory beside the other one, called "stm32f3-discovery-usb-example". Now cd into STM32F3-Discovery_FW_V1.1.0 and say:

patch -p1 < ../stm32f3-discovery-usb-example/STM32F3-Discovery_FW_V1.1.0-gcc.patch

This should say:

patching file .gitignore
patching file Libraries/CMSIS/Include/core_cm0.h
patching file Libraries/CMSIS/Include/core_cm3.h
patching file Libraries/CMSIS/Include/core_cm4.h
patching file Libraries/CMSIS/Include/core_sc000.h
patching file Libraries/CMSIS/Include/core_sc300.h
patching file Libraries/Makefile
patching file Libraries/STM32F30x_StdPeriph_Driver/src/stm32f30x_tim.c
patching file Libraries/STM32_USB-FS-Device_Driver/inc/usb_sil.h
patching file Libraries/STM32_USB-FS-Device_Driver/src/usb_sil.c
patching file Libraries/hw_config.h
patching file Libraries/stm32f30x_conf.h
patching file Libraries/usb_conf.h
patching file Makefile
patching file Project/Peripheral_Examples/USB_Example/usb_prop.c
patching file Utilities/Makefile

Make the install directory: "mkdir inst". Now say "make install" to make the ST code (ensure that /usr/local/arm/bin is in your PATH first!). This step makes libstm32f3.a and puts it into the inst directory, and also copies the header files to "inst"

Next, "cd ../stm32f3-discovery-usb-example" and say "make" there. This compiles the source files and makes main.elf, which is what you upload to the STM32F3Discovery board. You can say "make program" to upload it, or "make debug" to upload it and run it using gdb and the openocd debug adapter (you need openocd installed and working for this)

I just tested this, right up to main.elf - I don't have my STM32F3Discovery with me here on holidays.