Open changtimwu opened 9 years ago
SPI flash schematics of stm3210c http://www.st.com/st-web-ui/static/active/en/resource/technical/document/user_manual/CD00212441.pdf
reference doc http://wenku.baidu.com/view/bccdaa5c804d2b160b4ec0ec?fr=prin
SD signal | N-KEY | 3210C |
---|---|---|
card detect | PD2 | PE0 |
chip select | PA4 | PA4 |
MISO | PC11 | PC11 |
MOSI | PC12 | PC12 |
SCLK | PC10 | PC10 |
disable optimization(-O0) to debug
That guy clive1
is right. It works with a 2GB SD card.
http://www.openedv.com/posts/list/37.htm Someone has released SPI+SD block addressing on STM32. Porting it to to mach cube's HAL or SPL api.
locked in ETH_GetSoftwareResetStatus () == SET
https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https%3a%2f%2fmy%2est%2ecom%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fcortex_mx_stm32%2fStm32F2%20%20Ethernet%20start%20up%20infinite%20Loop&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=2230
The problematic code block.
/*--------------------------------- DMA ------------------------------------*/
/**
* @brief Resets all MAC subsystem internal registers and logic.
* @param None
* @retval None
*/
void ETH_SoftwareReset(void)
{
/* Set the SWR bit: resets all MAC subsystem internal registers and logic */
/* After reset all the registers holds their respective reset values */
ETH->DMABMR |= ETH_DMABMR_SR;
}
/**
* @brief Checks whether the ETHERNET software reset bit is set or not.
* @param None
* @retval The new state of DMA Bus Mode register SR bit (SET or RESET).
*/
FlagStatus ETH_GetSoftwareResetStatus(void)
{
FlagStatus bitstatus = RESET;
if((ETH->DMABMR & ETH_DMABMR_SR) != (uint32_t)RESET)
{
bitstatus = SET;
}
else
{
bitstatus = RESET;
}
return bitstatus;
}
related defines
#define ETH_DMABMR_SR ((uint32_t)0x00000001) /* Software reset */
related document 29.8.4 DMA register description
The issue summarized in one sentence. _When we did a reset to the ethernet's DMA, it's never completed.
Got Answer!!: The link MII_TXCLK <-> PC3 has been disconnected for some unknown reason.
f107 reference manual here http://www.st.com/web/en/resource/technical/document/reference_manual/CD00171190.pdf
16 pin MII signals
unknown related PIN
PTP pins
原本接在PB5 的 mode 2 請改接到沒使用的PB9 PB5 要拿來當作 1588 PPS pin PB5 要當 mode 2 請記得去調整 AFIO_MAPR, 把PTP_PPS bit set as 0
some ETH not remap reference http://www.oryx-embedded.com/doc/stm32f107__eth_8c_source.html
mii example http://andybrown.me.uk/2012/09/01/ethernet-phy-stm32f107/
another PHY http://www.farnell.com/datasheets/1700434.pdf
DIP switch
button
LED
ST's 2009 old code. Its SPL is 3.1.2. 智嵌's code is almost identical to this.
http://www.st.com/web/en/catalog/tools/PF257862#
Let's check the JUMPER. See anything different between 3210C in MII mode and NKEY.
check if input 25Mhz clock is on PA1(RX_CLK) & PC3(TX_CLK) .
KEIL install
C:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\1.1.0\Flash\STM32F10x_CL.FLM
into C:\Keil_v5\ARM\flash
RX works but TX doesn't work. It's because LocalTime
not get increased and TX jobs(ex. ARP timer) are all based on the value of LocalTime
.
LocalTime
-> Time_Update()
-> SysTick_Handler()
SysTick_Handler() is ISR...and why it's not triggered??
TX fails and on the switch side you can spot CRC errors.
every octet seems OR with 0x44
. ex
0xff | 0x44 -> 0xff 0x00 | 0x44 -> 0x44 0x01 | 0x44 -> 0x45
for cortex m3(ex. f107), specify the core speed as 72 instead of 168 http://armcortexm.blogs.upv.es/stm32f4-discovery-and-printf-redirection-to-debug-viewer-in-keil/ Add the following code to make printf work