Refs #1794. Improved USB D+ pull-up handling in the Olimexino-STM32F3 demo programs.

git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@1070 5dc33758-31d5-4daf-9ae8-b24bf3d40d73
This commit is contained in:
Frank Voorburg 2023-06-16 10:39:12 +00:00
parent fedebb7b8c
commit c280af5b89
10 changed files with 4980 additions and 4845 deletions

View File

@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-666769791631151900" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-622572724803305174" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
@ -16,7 +16,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-666769791631151900" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-622572724803305174" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>

View File

@ -67,6 +67,8 @@
*/
#include "stm32f3xx.h"
#include "stm32f3xx_ll_bus.h"
#include "stm32f3xx_ll_gpio.h"
/**
* @}
@ -169,6 +171,8 @@ const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4};
*/
void SystemInit(void)
{
LL_GPIO_InitTypeDef GPIO_InitStruct = {0};
/* FPU settings --------------------------------------------------------------*/
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */
@ -178,6 +182,31 @@ void SystemInit(void)
#if defined(USER_VECT_TAB_ADDRESS)
SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
#endif /* USER_VECT_TAB_ADDRESS */
/* Out of reset, the Olimexino-STM32F3 board enables a pull-up on the USB_DP line. If
* the board already enumerated, then it might stay in that state, even after a reset.
*
* It is therefore best to first make sure the USB device disconnects from the USB
* host. This is done by configuring USB DISC (PC12) as a digital output and setting
* it logic high, to turn the P-MOSFET off, which disables the pull-up on the USB_DP
* line.
*
* At the start of a debugging session, the code typically runs to an automatically
* placed breakpoint in main(). To aid debugging, the USB device disconnection is
* therefore done here in SystemInit(), because this function runs before main().
*
* During the actual USB initialization, the USB DISC pin state will be chaged, such
* that the USB_DP pull-up activates again, which is needed for the host to start the
* enumeration process.
*/
LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_GPIOC);
LL_GPIO_SetOutputPin(GPIOC, LL_GPIO_PIN_12);
GPIO_InitStruct.Pin = LL_GPIO_PIN_12;
GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT;
GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
GPIO_InitStruct.Pull = LL_GPIO_PULL_NO;
LL_GPIO_Init(GPIOC, &GPIO_InitStruct);
}
/**

View File

@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-666769791631151900" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-622572724803305174" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
@ -16,7 +16,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-666769791631151900" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-622572724803305174" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>

View File

@ -67,6 +67,8 @@
*/
#include "stm32f3xx.h"
#include "stm32f3xx_ll_bus.h"
#include "stm32f3xx_ll_gpio.h"
/**
* @}
@ -169,6 +171,8 @@ const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4};
*/
void SystemInit(void)
{
LL_GPIO_InitTypeDef GPIO_InitStruct = {0};
/* FPU settings --------------------------------------------------------------*/
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */
@ -178,6 +182,31 @@ void SystemInit(void)
#if defined(USER_VECT_TAB_ADDRESS)
SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
#endif /* USER_VECT_TAB_ADDRESS */
/* Out of reset, the Olimexino-STM32F3 board enables a pull-up on the USB_DP line. If
* the board already enumerated, then it might stay in that state, even after a reset.
*
* It is therefore best to first make sure the USB device disconnects from the USB
* host. This is done by configuring USB DISC (PC12) as a digital output and setting
* it logic high, to turn the P-MOSFET off, which disables the pull-up on the USB_DP
* line.
*
* At the start of a debugging session, the code typically runs to an automatically
* placed breakpoint in main(). To aid debugging, the USB device disconnection is
* therefore done here in SystemInit(), because this function runs before main().
*
* During the actual USB initialization, the USB DISC pin state will be chaged, such
* that the USB_DP pull-up activates again, which is needed for the host to start the
* enumeration process.
*/
LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_GPIOC);
LL_GPIO_SetOutputPin(GPIOC, LL_GPIO_PIN_12);
GPIO_InitStruct.Pin = LL_GPIO_PIN_12;
GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT;
GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
GPIO_InitStruct.Pull = LL_GPIO_PULL_NO;
LL_GPIO_Init(GPIOC, &GPIO_InitStruct);
}
/**

View File

@ -1,29 +1,29 @@
S02100006F70656E626C745F6F6C696D6578696E6F5F73746D333266332E737265632B
S31508000000682A00205D830008758300087983000844
S315080000107D830008818300088583000800000000AE
S3150800002000000000000000000000000089830008AE
S315080000308D8300080000000091830008B579000848
S3150800004095830008998300089D830008A18300080A
S31508000050A5830008A9830008AD830008B1830008BA
S31508000060B5830008B9830008BD830008C18300086A
S31508000070C5830008C9830008CD830008D18300081A
S31508000080D5830008D9830008DD830008E1830008CA
S31508000090E5830008E9830008ED830008F18300087A
S315080000A0F5830008F9830008FD8300080184000829
S315080000B005840008098400080D84000811840008D6
S315080000C015840008198400081D8400082184000886
S315080000D025840008298400082D8400083184000836
S315080000E035840008398400083D84000841840008E6
S315080000F045840008498400084D8400085184000896
S315080001000000000000000000000000005584000800
S31508000110598400085D840008618400086584000825
S31508000120698400086D8400087184000875840008D5
S31508000130798400087D8400080000000000000000A3
S31508000140818400088584000889840008000000006E
S31508000000682A0020BD830008D5830008D983000824
S31508000010DD830008E1830008E5830008000000008E
S31508000020000000000000000000000000E98300084E
S31508000030ED83000800000000F1830008B579000888
S31508000040F5830008F9830008FD8300080184000889
S3150800005005840008098400080D8400081184000836
S3150800006015840008198400081D84000821840008E6
S3150800007025840008298400082D8400083184000896
S3150800008035840008398400083D8400084184000846
S3150800009045840008498400084D84000851840008F6
S315080000A055840008598400085D84000861840008A6
S315080000B065840008698400086D8400087184000856
S315080000C075840008798400087D8400088184000806
S315080000D085840008898400088D84000891840008B6
S315080000E095840008998400089D840008A184000866
S315080000F0A5840008A9840008AD840008B184000816
S31508000100000000000000000000000000B5840008A0
S31508000110B9840008BD840008C1840008C5840008A5
S31508000120C9840008CD840008D1840008D584000855
S31508000130D9840008DD8400080000000000000000E3
S31508000140E1840008E5840008E9840008000000004E
S315080001500000000000000000000000000000000091
S3150800016000000000000000008D840008918400084B
S315080001709584000800000000000000000000000050
S3150800018000000000998400084178007840EA0120C0
S315080001600000000000000000ED840008F18400088B
S31508000170F5840008000000000000000000000000F0
S3150800018000000000F98400084178007840EA012060
S315080001907047C178827842EA0122417841EA022111
S315080001A0007840EA012070470170090A41707047DB
S315080001B00170090A4170090A8170090AC1707047FD
@ -683,7 +683,7 @@ S31508002A800240FFF78DB8104890F82812012901D1A5
S31508002A90FEF7AEBF704710B50B4C94F82812012903
S31508002AA00CD12146FFF728F9002807D5002084F81D
S31508002AB028022046BDE81040FEF79ABF10BD000068
S31508002AC00008004870820008600B00202F626F6FB4
S31508002AC000080048F0820008600B00202F626F6F34
S31508002AD0746C6F672E7478740000000062F30F221E
S31508002AE062F31F42401810F0030308D0C91A1FD317
S31508002AF0DB0748BF00F8012D28BF20F8022D130078
@ -1128,7 +1128,7 @@ S31508004650582300228021D4F8C00200F008FAC023AB
S3150800466000228121D4F8C00200F001FA4FF48873C1
S3150800467000220121D4F8C00200F0F9F94FF4807342
S3150800468000228221D4F8C00200F0F1F9002010BD02
S31508004690A880000810ED00E0B0050020005C00408E
S315080046902881000810ED00E0B0050020005C00400D
S315080046A080B5D0F8C002FEF7C8FABDE8024067E058
S315080046B080B5D0F8C002FEF7D6FABDE802405FE042
S315080046C080B5D0F8C002FEF7E7FABDE8024057E029
@ -1392,7 +1392,7 @@ S315080056D001EB00212960BF1C384600F06CF82968E8
S315080056E008182860BD1C771F3FB2002C0DD0002675
S315080056F006E0284600F05FF804F80800AD1C761CA2
S31508005700B0461FFA88F8B845F3DB3846BDE8F0819D
S31508005710601A002058010020F4810008147E000851
S31508005710601A00205801002074820008147E0008D0
S31508005720880300201417002094150020847E0008A2
S3150800573094030020B47E0008D87E0008FC7E00088A
S3150800574080B500F00F0130310A2801DBC91D04E0DD
@ -1536,7 +1536,7 @@ S31508005FD06AFB8542F3D207B030BD30B587B00346B9
S31508005FE00C4600256A4629460C4800F081FF002821
S31508005FF008D1009840F26761884203D102980028C8
S3150800600000D101252846012801D104982070284688
S3150800601007B030BD4C82000844810008F8190020FA
S3150800601007B030BDCC820008C4810008F8190020FA
S3150800602000640040016841F00101016070470168A1
S315080060304908490001607047C069400900F001003D
S315080060407047C069C00900F001007047808CC0B273
@ -1560,7 +1560,7 @@ S31508006150040003D03046FFF779FF28702046401E1A
S315080061608041C043C00F70BD38B50146094C204672
S31508006170FFF76FFFFCF797FA05460A352046FFF743
S3150800618060FF002805D1FCF79EFAFCF78CFA8542D9
S31508006190F4D231BD00480040048100086017002091
S31508006190F4D231BD00480040848100086017002011
S315080061A038B500F0F5F8BC4D4021681C00F005F93B
S315080061B02870BA4C4021601C00F0FFF8207029783E
S315080061C0FF2901D0FF2803D18421B548FEF74BFCEF
@ -1609,7 +1609,7 @@ S3150800646048748868401C886048688A68904201D2E7
S3150800647008688860012032BD10B50446022C04DB8A
S315080064804FF4FF710648FEF7EEFA0B4804EB440199
S3150800649000EBC100407C10BD78180020BC18002015
S315080064A0808100089C08002008010020D0000020F8
S315080064A0008200089C08002008010020D000002077
S315080064B00019002044190020C41900204FF0FF30AD
S315080064C06D4908606D490860704730B40B466C49E1
S315080064D00C1A5D1EAC4206D36A4CA04203D31D18A3
@ -1720,7 +1720,7 @@ S31508006B50241002400CC0FFF8FFFFF6FE00127A0070
S31508006B6000000110000002100000031000000412CB
S31508006B700000081200000C1200301000003020003F
S31508006B800030300000C0400000C0800000C0C000D7
S31508006B90E88200086C83000800093D0038B5040047
S31508006B9018810008CC83000800093D0038B50400B8
S31508006BA001D1012032BD94F82000002802D12046E8
S31508006BB000F001FF2068016841F001010160FBF760
S31508006BC07FFD054620684168C9070DD4FBF778FDA7
@ -2057,58 +2057,58 @@ S31508008060B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C70A
S31508008070C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7FA
S31508008080D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7EA
S31508008090E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7DA
S315080080A0F8F9FAFBFCFDFEFF433A5C576F726B5C0E
S315080080B0736F6674776172655C4F70656E424C5477
S315080080C05C5461726765745C44656D6F5C41524DC2
S315080080D0434D345F53544D333246335F4F6C696DAD
S315080080E06578696E6F5F53544D333246335F494145
S315080080F0525C426F6F745C757362645F636F6E6621
S315080081002E630000433A5C576F726B5C736F66743C
S31508008110776172655C4F70656E424C545C5461724F
S315080081206765745C536F757263655C41524D434D68
S31508008130345F53544D333246335C72733233322EC6
S3150800814063000000433A5C576F726B5C736F66742A
S31508008150776172655C4F70656E424C545C5461720F
S315080081606765745C536F757263655C41524D434D28
S31508008170345F53544D333246335C63616E2E63006D
S31508008180433A5C576F726B5C736F6674776172659E
S315080081905C4F70656E424C545C5461726765745CE2
S315080081A0536F757263655C41524D434D345F53544A
S315080081B04D333246335C7573622E630030B4002546
S315080081C012E050F8042BD30744BF4A44521E091F35
S315080081D0042942F8045BFAD213468C0744BF15807B
S315080081E09B1CC90748BF1D7050F8041B0029E8D11D
S315080081F030BC7047433A5C576F726B5C736F66743A
S31508008200776172655C4F70656E424C545C5461725E
S315080082106765745C536F757263655C66696C652E19
S315080082206300000010B5074979441831064C7C44B0
S31508008230163404E00A68081D114488470146A1421D
S31508008240F8D110BD74000000900000000502060277
S31508008250060307030803090309040A040B040C04AC
S315080082600C050D050E050F050F061006100710085C
S315080082702F64656D6F70726F675F6F6C696D657877
S31508008280696E6F5F73746D333266332E737265630E
S31508008290000000004EF68851CEF20001086840F44E
S315080082A070000860BFF34F8FBFF36F8F4FF00070F9
S315080082B0E1EE100A7047000005FFFFFF0C190000E9
S315080082C0580100200000000017A4FFFFD00100009D
S315080082D046010000000000200248016841F47001D0
S315080082E00160704788ED00E0000000000000000013
S315080082F0010203040607080900F00DF8002801D05A
S31508008300FFF790FFAFF300800020AFF30080FFF780
S3150800831016FA00F002F80120704700F001B80000D4
S315080083200746384600F002F8FBE7000080B5AFF3D1
S315080083300080024A11001820ABBEFBE726000200A7
S315080083400548014603B4684680F30988AFF3008000
S31508008350FFF7A0FFFFF7D0FFA5EDF5FE0148804720
S3150800836001480047D9820008418300080000000040
S3150800837001020304FFF7FEBFFFF7FEBFFFF7FEBFCC
S31508008380FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF13
S31508008390FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF03
S315080083A0FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFF3
S315080083B0FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFE3
S315080083C0FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFD3
S315080083D0FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFC3
S315080080A0F8F9FAFBFCFDFEFF81B018490A6802439D
S315080080B00A60096808400090009801B0704781611D
S315080080C0704710B586B0182200216846FAF7FDFAFF
S315080080D00F48016841F4700101604FF40020FFF772
S315080080E0E3FF0C4C4FF480512046FFF7E8FF4FF4AE
S315080080F08050009001200190002002900390049087
S3150800810069462046FAF7CEFB06B010BD14100240A9
S3150800811088ED00E0000800480000000000000000AC
S315080081200102030406070809433A5C576F726B5C41
S31508008130736F6674776172655C4F70656E424C54F6
S315080081405C5461726765745C44656D6F5C41524D41
S31508008150434D345F53544D333246335F4F6C696D2C
S315080081606578696E6F5F53544D333246335F4941C4
S31508008170525C426F6F745C757362645F636F6E66A0
S315080081802E630000433A5C576F726B5C736F6674BC
S31508008190776172655C4F70656E424C545C546172CF
S315080081A06765745C536F757263655C41524D434DE8
S315080081B0345F53544D333246335C72733233322E46
S315080081C063000000433A5C576F726B5C736F6674AA
S315080081D0776172655C4F70656E424C545C5461728F
S315080081E06765745C536F757263655C41524D434DA8
S315080081F0345F53544D333246335C63616E2E6300ED
S31508008200433A5C576F726B5C736F6674776172651D
S315080082105C4F70656E424C545C5461726765745C61
S31508008220536F757263655C41524D434D345F5354C9
S315080082304D333246335C7573622E630030B40025C5
S3150800824012E050F8042BD30744BF4A44521E091FB4
S31508008250042942F8045BFAD213468C0744BF1580FA
S315080082609B1CC90748BF1D7050F8041B0029E8D19C
S3150800827030BC7047433A5C576F726B5C736F6674B9
S31508008280776172655C4F70656E424C545C546172DE
S315080082906765745C536F757263655C66696C652E99
S315080082A06300000010B5074979441831064C7C4430
S315080082B0163404E00A68081D114488470146A1429D
S315080082C0F8D110BD740000009000000005020602F7
S315080082D0060307030803090309040A040B040C042C
S315080082E00C050D050E050F050F06100610071008DC
S315080082F02F64656D6F70726F675F6F6C696D6578F7
S31508008300696E6F5F73746D333266332E737265638D
S31508008310000000004EF68851CEF20001086840F4CD
S3150800832070000860BFF34F8FBFF36F8F4FF0007078
S31508008330E1EE100A7047000005FFFFFF0C19000068
S31508008340580100200000000097A3FFFFB0010000BD
S31508008350460100000000002000F00DF8002801D0BA
S31508008360FFF7A0FFAFF300800020AFF30080FFF710
S31508008370E6F900F002F80120704700F001B80000A5
S315080083800746384600F002F8FBE7000080B5AFF371
S315080083900080024A11001820ABBEFBE72600020047
S315080083A00548014603B4684680F30988AFF30080A0
S315080083B0FFF7B0FFFFF7D0FFA5EDF5FE01488047B0
S315080083C001480047C3800008A18300080000000098
S315080083D001020304FFF7FEBFFFF7FEBFFFF7FEBF6C
S315080083E0FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFB3
S315080083F0FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFA3
S31508008400FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF92
@ -2120,15 +2120,21 @@ S31508008450FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF42
S31508008460FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF32
S31508008470FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF22
S31508008480FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF12
S31508008490FFF7FEBFFFF7FEBFFFF7FEBF0004810030
S315080084A0F8000001F9000001F9000010FC000612AE
S315080084B07A000A061001FD00014001F9000E0902C2
S315080084C02000010100C0320904000002FFFD001966
S315080084D0070581024000FF070501024000FFA97158
S315080084E00008D3710008E9710008F8000B4D720006
S315080084F0085772000863720008F4000375720008D2
S31508008500FC00237D720008D17C0008D97C00080194
S315080085107D0008E17C0008137D0008217D000841E4
S315080085207D000812011001FD001240501DAC6000CC
S3140800853001010203010000040309041A03E6000F
S705080083412E
S31508008490FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBF02
S315080084A0FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFF2
S315080084B0FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFE2
S315080084C0FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFD2
S315080084D0FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFC2
S315080084E0FFF7FEBFFFF7FEBFFFF7FEBFFFF7FEBFB2
S315080084F0FFF7FEBFFFF7FEBFFFF7FEBF00048100D0
S31508008500F8000001F9000001F9000010FC0006124D
S315080085107A000A061001FD00014001F9000E090261
S315080085202000010100C0320904000002FFFD001905
S31508008530070581024000FF070501024000FFA971F7
S315080085400008D3710008E9710008F8000B4D7200A5
S31508008550085772000863720008F400037572000871
S31508008560FC00237D720008D17C0008D97C00080134
S315080085707D0008E17C0008137D0008217D00084184
S315080085807D000812011001FD001240501DAC60006C
S3140800859001010203010000040309041A03E600AF
S705080083A1CE

View File

@ -67,6 +67,8 @@
*/
#include "stm32f3xx.h"
#include "stm32f3xx_ll_bus.h"
#include "stm32f3xx_ll_gpio.h"
/**
* @}
@ -169,6 +171,8 @@ const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4};
*/
void SystemInit(void)
{
LL_GPIO_InitTypeDef GPIO_InitStruct = {0};
/* FPU settings --------------------------------------------------------------*/
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */
@ -178,6 +182,31 @@ void SystemInit(void)
#if defined(USER_VECT_TAB_ADDRESS)
SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
#endif /* USER_VECT_TAB_ADDRESS */
/* Out of reset, the Olimexino-STM32F3 board enables a pull-up on the USB_DP line. If
* the board already enumerated, then it might stay in that state, even after a reset.
*
* It is therefore best to first make sure the USB device disconnects from the USB
* host. This is done by configuring USB DISC (PC12) as a digital output and setting
* it logic high, to turn the P-MOSFET off, which disables the pull-up on the USB_DP
* line.
*
* At the start of a debugging session, the code typically runs to an automatically
* placed breakpoint in main(). To aid debugging, the USB device disconnection is
* therefore done here in SystemInit(), because this function runs before main().
*
* During the actual USB initialization, the USB DISC pin state will be chaged, such
* that the USB_DP pull-up activates again, which is needed for the host to start the
* enumeration process.
*/
LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_GPIOC);
LL_GPIO_SetOutputPin(GPIOC, LL_GPIO_PIN_12);
GPIO_InitStruct.Pin = LL_GPIO_PIN_12;
GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT;
GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
GPIO_InitStruct.Pull = LL_GPIO_PULL_NO;
LL_GPIO_Init(GPIOC, &GPIO_InitStruct);
}
/**

View File

@ -67,6 +67,8 @@
*/
#include "stm32f3xx.h"
#include "stm32f3xx_ll_bus.h"
#include "stm32f3xx_ll_gpio.h"
/**
* @}
@ -169,6 +171,8 @@ const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4};
*/
void SystemInit(void)
{
LL_GPIO_InitTypeDef GPIO_InitStruct = {0};
/* FPU settings --------------------------------------------------------------*/
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */
@ -178,6 +182,31 @@ void SystemInit(void)
#if defined(USER_VECT_TAB_ADDRESS)
SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
#endif /* USER_VECT_TAB_ADDRESS */
/* Out of reset, the Olimexino-STM32F3 board enables a pull-up on the USB_DP line. If
* the board already enumerated, then it might stay in that state, even after a reset.
*
* It is therefore best to first make sure the USB device disconnects from the USB
* host. This is done by configuring USB DISC (PC12) as a digital output and setting
* it logic high, to turn the P-MOSFET off, which disables the pull-up on the USB_DP
* line.
*
* At the start of a debugging session, the code typically runs to an automatically
* placed breakpoint in main(). To aid debugging, the USB device disconnection is
* therefore done here in SystemInit(), because this function runs before main().
*
* During the actual USB initialization, the USB DISC pin state will be chaged, such
* that the USB_DP pull-up activates again, which is needed for the host to start the
* enumeration process.
*/
LL_AHB1_GRP1_EnableClock(LL_AHB1_GRP1_PERIPH_GPIOC);
LL_GPIO_SetOutputPin(GPIOC, LL_GPIO_PIN_12);
GPIO_InitStruct.Pin = LL_GPIO_PIN_12;
GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT;
GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
GPIO_InitStruct.Pull = LL_GPIO_PULL_NO;
LL_GPIO_Init(GPIOC, &GPIO_InitStruct);
}
/**