Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not apply the patch #2

Open
itsnewdroid opened this issue Dec 25, 2015 · 2 comments
Open

Can not apply the patch #2

itsnewdroid opened this issue Dec 25, 2015 · 2 comments

Comments

@itsnewdroid
Copy link

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

@cjheath
Copy link
Owner

cjheath commented Dec 26, 2015

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
Copy link
Owner

cjheath commented Dec 27, 2015

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 [email protected]: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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants