Fórum témák

» Több friss téma
Fórum » ARM - Miértek hogyanok
 
Témaindító: gtk, idő: Jún 26, 2007
Lapozás: OK   115 / 176
(#) gtk válasza cimopata hozzászólására (») Márc 29, 2018 /
 
Minden olyan constans erteket es valtozot amelyik nem uint32 kenyszerits uint32-re:
  1. (uint32_t)2048
,...Ha #define-al fogod csinalni, akkor is !
  1. #define konst (uint32_t)2048

A current valtozoid hany bitesek, belefer minden esetben amit szamolsz ? Mert ha nem, akkor lehet hogy felulirodik valami.
A hozzászólás módosítva: Márc 29, 2018
(#) gtk válasza cimopata hozzászólására (») Márc 29, 2018 /
 
Meg egy eszrevetel, vigyazz hogy semmilyen korulmenyek kozott ne tudjon atmenni negativ ertekbe amit szamolsz.
(#) Attis92 válasza gtk hozzászólására (») Márc 29, 2018 /
 
Teljesen igaz, amit írtál, de ha jól tudom, akkor elég az is ha csak jelölöd, hogy
ha uint32_t
  1. 2048U

ha int32_t
  1. 2048

ha float
  1. 2048.0f

mert az alapértelmezett hosszúság a 32bit.
(#) gtk válasza Attis92 hozzászólására (») Márc 29, 2018 /
 
Atlathatobb ha konkretan kiirod.
(#) cimopata válasza Kovidivi hozzászólására (») Márc 29, 2018 /
 
Persze, minden szépen megy addig míg csak uint16_t ben van.

Csináltam egy olyat hogy létrehoztam egy másik változót még az if előtt abba írom bele az adc_store és az offset értékét. Azt vizsgálja meg az If elágazás és miután belépett az if-be vagy az else-be akkor átmásolom az értékét egy 32 bites változóba és onnantól már működik a dolog.

Mindenesetre nagyon fura hogy ilyen megoldást kellett csináljak és egyszerűen 1 változóval végigszámolva nem működik.
(#) artur60 válasza cimopata hozzászólására (») Márc 30, 2018 /
 
kurvaanyad = (uint32_t)adc_store[1] + offset1;

Ezt próbáld ki hátha segít.
(#) cimopata válasza artur60 hozzászólására (») Márc 31, 2018 /
 
Sajnos nem, de más módszerrel sikerült. Létrehoztam egy harmadik változót amit csak ideiglenesen használok míg be nem lép az if-be itt pedig átrakja egy másikba. Nem értem miért de úgy megy.

köszi azért.
(#) csatti2 válasza cimopata hozzászólására (») Márc 31, 2018 /
 
Próbáltad különböző optimalizációs szintekkel? Nekem volt egy hasonló WTF esetem külső SRAM használatakor, amikor az -O2 esetén mindenféle fura hibám volt, míg -O1-el tökéletesen működött.
Érdemes lehet még assembly-ben léptetni a kódot és figyelni a regisztereket, illetve milyen utasítások is hajtódnak ténylegesen végre.
(#) don_peter hozzászólása Ápr 1, 2018 /
 
Srácok, STM32F103-as MCU-val szeretnék egy külső SRAM-ot kezelni.
1MB-os memória van rajta, próbálkozom a gyári könyvtárával, de valamiért nem tudom működésre bírni. Valamit csinál, de az nem jó, ellenőrzésnél is elhasal.

Gyári fejlesztőpanelt használok, ilyet: Bővebben: Link

Nincs véletlen valakinél elfekvőben egy működő (tesztelt) példa program?
3 napja kínlódok vele, de nem jutok előre, vagy elnézek valamit vagy csak simán nem jó a gyári konfigurálás.
Előre is köszi..
(#) csatti2 válasza don_peter hozzászólására (») Ápr 1, 2018 / 1
 
  1. // General FSMC configuration
  2. static void FSMC_CtrlLinesConfig(void)
  3. {
  4.   GPIO_InitTypeDef GPIO_InitStructure;
  5.  
  6.   /* Enable FSMC, GPIOD, GPIOE, GPIOF, GPIOG and AFIO clocks */
  7.   RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);
  8.  
  9.   RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD | RCC_APB2Periph_GPIOE | RCC_APB2Periph_GPIOF |
  10.                          RCC_APB2Periph_GPIOG | RCC_APB2Periph_AFIO, ENABLE);
  11.  
  12.   // Data lines
  13.  
  14.   /* Set PD.00(D2), PD.01(D3), PD.04(NOE), PD.05(NWE), PD.08(D13), PD.09(D14),
  15.    PD.10(D15), PD.14(D0), PD.15(D1) as alternate function push pull */
  16.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_4 | GPIO_Pin_5 |
  17.                                 GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 | GPIO_Pin_14 |
  18.                                 GPIO_Pin_15;
  19.   GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  20.   GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
  21.   GPIO_Init(GPIOD, &GPIO_InitStructure);
  22.  
  23.   /* Set PE.07(D4), PE.08(D5), PE.09(D6), PE.10(D7), PE.11(D8), PE.12(D9), PE.13(D10),
  24.    PE.14(D11), PE.15(D12) as alternate function push pull */
  25.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7 | GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 |
  26.                                 GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14 |
  27.                                 GPIO_Pin_15;
  28.   GPIO_Init(GPIOE, &GPIO_InitStructure);
  29.  
  30.   // Address lines
  31.  
  32.   /* Set PF.00(A0), PF.01(A1), PF.02(A2), PF.03(A3), PF.04(A4), PF.05(A5), PF.12(A6),
  33.    PF.13(A7), PF.14(A8), PF.15(A9) as alternate function push pull */
  34.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 |
  35.                                 GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_12 | GPIO_Pin_13 |
  36.                                 GPIO_Pin_14 | GPIO_Pin_15;
  37.   GPIO_Init(GPIOF, &GPIO_InitStructure);
  38.  
  39.   /* Set PG.00(A10), PG.01(A11), PG.02(A12), PG.03(A13), PG.04(A14), PG.05(A15)
  40.    as alternate function push pull */
  41.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 |
  42.                                 GPIO_Pin_4 | GPIO_Pin_5;
  43.   GPIO_Init(GPIOG, &GPIO_InitStructure);
  44.  
  45.   /* Set PD.11(A16), PD.12(A17), PD.13(A18)
  46.    as alternate function push pull */
  47.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13;
  48.   GPIO_Init(GPIOD, &GPIO_InitStructure);
  49.  
  50.   /* Set PE.3(A19)
  51.    as alternate function push pull */
  52.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3;
  53.   GPIO_Init(GPIOE, &GPIO_InitStructure);
  54.  
  55. #ifdef CS_EXTENSION
  56.   /* Set PE.2(A23)
  57.    as alternate function push pull */
  58.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;
  59.   GPIO_Init(GPIOE, &GPIO_InitStructure);
  60.   /* Set PG.13(A24)
  61.    as alternate function push pull */
  62.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13;
  63.   GPIO_Init(GPIOG, &GPIO_InitStructure);
  64. #endif
  65.  
  66. }
  67.  
  68. // External SRAM
  69.  
  70. void SRAM_CtrlLinesConfig(void)
  71. {
  72.   GPIO_InitTypeDef GPIO_InitStructure;
  73.  
  74.   FSMC_CtrlLinesConfig();
  75.  
  76.   RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOG | RCC_APB2Periph_GPIOE, ENABLE);
  77.  
  78.   // SRAM chip select
  79.  
  80.   /* Set PG.10(NE3) as alternate function push pull */
  81.   GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
  82.   GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  83.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
  84.   GPIO_Init(GPIOG, &GPIO_InitStructure);
  85.  
  86.   /* Set PE.00(NBL0), PE.01(NBL1) as alternate function push pull */
  87.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1;
  88.   GPIO_Init(GPIOE, &GPIO_InitStructure);
  89. }
  90.  
  91. void SRAM_FSMCConfig(void)
  92. {
  93.   FSMC_NORSRAMTimingInitTypeDef  FSMC_NORSRAMTimingInitStructure;;
  94.   FSMC_NORSRAMInitTypeDef  FSMC_NORSRAMInitStructure;
  95.  
  96.   // FSMC Configuration
  97.  
  98.   FSMC_NORSRAMTimingInitStructure.FSMC_AddressSetupTime = 3; //3
  99.   FSMC_NORSRAMTimingInitStructure.FSMC_AddressHoldTime = 0; //0
  100.   FSMC_NORSRAMTimingInitStructure.FSMC_DataSetupTime = 3; //3
  101.   FSMC_NORSRAMTimingInitStructure.FSMC_BusTurnAroundDuration = 0;
  102.   FSMC_NORSRAMTimingInitStructure.FSMC_CLKDivision = 0;
  103.   FSMC_NORSRAMTimingInitStructure.FSMC_DataLatency = 0;
  104.   FSMC_NORSRAMTimingInitStructure.FSMC_AccessMode = FSMC_AccessMode_A;
  105.  
  106.   FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM3;
  107.   FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable;
  108.   FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_SRAM;
  109.   FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;
  110.   FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable;
  111.   FSMC_NORSRAMInitStructure.FSMC_WaitSignalPolarity = FSMC_WaitSignalPolarity_Low;
  112.   FSMC_NORSRAMInitStructure.FSMC_WrapMode = FSMC_WrapMode_Disable;
  113.   FSMC_NORSRAMInitStructure.FSMC_WaitSignalActive = FSMC_WaitSignalActive_BeforeWaitState;
  114.   FSMC_NORSRAMInitStructure.FSMC_WriteOperation = FSMC_WriteOperation_Enable;
  115.   FSMC_NORSRAMInitStructure.FSMC_WaitSignal = FSMC_WaitSignal_Disable;
  116.   FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Disable;
  117.   FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable;
  118.   FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &FSMC_NORSRAMTimingInitStructure;
  119.   FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &FSMC_NORSRAMTimingInitStructure;
  120.  
  121.   FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure);
  122.  
  123.   // Enable FSMC Bank1_SRAM Bank
  124.   FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM3, ENABLE);
  125.  
  126.   // Enable the DMA Clock
  127.   RCC_AHBPeriphClockCmd(MEM_DMA_CLK, ENABLE);
  128. }
  129.  
  130.  
  131. void SRAM_Configuration(void)
  132. {
  133.   SRAM_CtrlLinesConfig();
  134.   SRAM_FSMCConfig();
  135. }
  136.  
  137. uint32_t SRAM_Test(void)
  138. {
  139.   __IO uint32_t addr;
  140.  
  141.   for( addr = SRAM_START_ADDR; addr < SRAM_END_ADDR + 1 ; addr += 4 ) {
  142.     *(uint32_t *)addr = addr;
  143.   }
  144.  
  145.   for( addr = SRAM_START_ADDR; addr < SRAM_END_ADDR + 1 ; addr += 4 ) {
  146.     if (*(uint32_t *)addr != addr) {
  147.       break;
  148.     }
  149.   }
  150.  
  151.   if( addr >= SRAM_END_ADDR + 1 ) {
  152.     return 0; // OK
  153.   } else {
  154.     return addr; // Failed at address
  155.   }
  156.  
  157. }
  158.  
  159. // External SRAM
  160. /* Address calculation:
  161.   Base address for FSMC banks:
  162.     = 0x60000000
  163.   Offset for bank NEx:
  164.     = 0x04000000 * (x - 1)
  165.     NE1: 0x00000000
  166.     NE2: 0x04000000
  167.     NE3: 0x08000000
  168.     NE4: 0x0C000000
  169.   Offset for LCD register select with Ay:
  170.     = 2^y (for 8 bit bus)
  171.     = 2^(y+1) (for 16 bit bus)
  172. */
  173. #define SRAM_START_ADDR                   ((uint32_t)0x68000000)
  174. #define SRAM_END_ADDR                     ((uint32_t)0x680FFFFF)
  175. #define EXTRAM                                    __attribute__((section(".extram")))
  176.  
  177. példa:
  178. uint8_t EXTRAM lcdScreenBuffer[LCD_DATASIZE];
  179. uint8_t EXTRAM lcdImageBuffer[LCD_DATASIZE];
  180.  
  181. Linker script:
  182. MEMORY
  183. {
  184.     ROM     (rx)  : ORIGIN = 0x08040000, LENGTH = 256K
  185.     RAM     (rwx) : ORIGIN = 0x20000000, LENGTH = 64K
  186.     EXTRAM  (rwx) : ORIGIN = 0x68000000, LENGTH = 1024K
  187. }
  188. __EEPROM_SIZE = 0x4000;
  189.  
  190. .extram (NOLOAD):
  191.         {
  192.     *(.extram*)
  193.     . = ALIGN(__EEPROM_SIZE);
  194.     __ee_start__ = .;
  195.     *(.eepromshared*)
  196.     *(.eepromdata*)
  197.     __ee_end__ = .;
  198.     . = ALIGN(__EEPROM_SIZE);
  199.     __extram_end__ = .;
  200.         } > EXTRAM


Ezt a kódot ezzel a fejlesztőpanellel használtam:
https://www.waveshare.com/product/mcu-tools/stm32/open/open103z-pac...-a.htm

Az oldal alján találsz linket a kapcsolási rajzhoz ha szükséges.
A hozzászólás módosítva: Ápr 1, 2018
(#) don_peter válasza csatti2 hozzászólására (») Ápr 1, 2018 /
 
Köszi, már is megnézem..
(#) don_peter válasza csatti2 hozzászólására (») Ápr 1, 2018 /
 
Sajnos egyelőre ugyan azt csinálja mint az én kódom..
A linker állományt hol találom amúgy?

IAR Embedded Workbench-et használók, abból is a 7.60-as verziót.
(#) csatti2 válasza don_peter hozzászólására (») Ápr 1, 2018 /
 
Fogalmam sincs, sohasem használtam IAR workbenchet.

Megvan valahol a kapcsolási rajza a fejlesztőkártyádnak?
(#) don_peter válasza csatti2 hozzászólására (») Ápr 1, 2018 /
 
Neten biztos van,de nekem nincs hozzá, de mivel FSMC gyári könyvtárát használom, mennie kellene. Integrálva van rá az SRAM.
Közben megtaláltam: Bővebben: Link

Csatolom a kódomat:
  1. /******************** (C) COPYRIGHT 2008 STMicroelectronics ********************
  2. * File Name          : fsmc_sram.c
  3. * Author             : MCD Application Team
  4. * Version            : V2.0.3
  5. * Date               : 09/22/2008
  6. * Description        : This file provides a set of functions needed to drive the
  7. *                      IS61WV51216BLL SRAM memory
  8. ********************************************************************************
  9. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  10. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
  11. * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
  12. * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
  13. * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
  14. * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  15. *******************************************************************************/
  16.  
  17. /* Includes ------------------------------------------------------------------*/
  18. #include "fsmc_sram.h"
  19.  
  20. /* Private typedef -----------------------------------------------------------*/
  21. /* Private define ------------------------------------------------------------*/
  22. //#define Bank1_SRAM3_ADDR        ((u32)0x60000000)
  23. //#define Bank2_SRAM3_ADDR        ((u32)0x64000000)
  24. //#define Bank3_SRAM3_ADDR        ((u32)0x68000000)
  25. //#define Bank4_SRAM3_ADDR        ((u32)0x6C000000)
  26. #define Bank1_SRAM3_ADDR        ((u32)0x68000000)
  27.  
  28. /* Private macro -------------------------------------------------------------*/
  29. /* Private variables ---------------------------------------------------------*/
  30. /* Private function prototypes -----------------------------------------------*/
  31. /* Private functions ---------------------------------------------------------*/
  32.  
  33. /*******************************************************************************
  34. * Function Name  : FSMC_SRAM_Init
  35. * Description    : Configures the FSMC and GPIOs to interface with the SRAM memory.
  36. *                  This function must be called before any write/read operation
  37. *                  on the SRAM.
  38. * Input          : None
  39. * Output         : None
  40. * Return         : None
  41. *******************************************************************************/
  42. void FSMC_SRAM_Init(void)
  43. {
  44.   FSMC_NORSRAMInitTypeDef  FSMC_NORSRAMInitStructure;
  45.   FSMC_NORSRAMTimingInitTypeDef  p;
  46.   GPIO_InitTypeDef GPIO_InitStructure;
  47.  
  48.   RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD | RCC_APB2Periph_GPIOG | RCC_APB2Periph_GPIOE |
  49.                          RCC_APB2Periph_GPIOF, ENABLE);
  50.  
  51. /*-- GPIO Configuration ------------------------------------------------------*/
  52.   /* SRAM Data lines configuration */
  53.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_8 | GPIO_Pin_9 |
  54.                                 GPIO_Pin_10 | GPIO_Pin_14 | GPIO_Pin_15;
  55.   GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
  56.   GPIO_InitStructure.GPIO_Speed = GPIO_Speed_10MHz;
  57.   GPIO_Init(GPIOD, &GPIO_InitStructure);
  58.  
  59.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7 | GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 |
  60.                                 GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14 |
  61.                                 GPIO_Pin_15;
  62.   GPIO_Init(GPIOE, &GPIO_InitStructure);
  63.  
  64.   /* SRAM Address lines configuration */
  65.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 |
  66.                                 GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_12 | GPIO_Pin_13 |
  67.                                 GPIO_Pin_14 | GPIO_Pin_15;
  68.   GPIO_Init(GPIOF, &GPIO_InitStructure);
  69.  
  70.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 |
  71.                                 GPIO_Pin_4 | GPIO_Pin_5;
  72.   GPIO_Init(GPIOG, &GPIO_InitStructure);
  73.  
  74.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13;
  75.   GPIO_Init(GPIOD, &GPIO_InitStructure);
  76.  
  77.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3;
  78.   GPIO_Init(GPIOE, &GPIO_InitStructure);
  79.    
  80.   /* NOE and NWE configuration */  
  81.   // D4 <-> OUTPUT Enabled
  82.   // D5 <-> WRITE Enabled
  83.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4 | GPIO_Pin_5; // 7-es PIN a FAMC_NE1
  84.   GPIO_Init(GPIOD, &GPIO_InitStructure);
  85.  
  86.   /* NE3 configuration */
  87.   // CHIP Select
  88.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
  89.   GPIO_Init(GPIOG, &GPIO_InitStructure);
  90.  
  91.   /* NBL0, NBL1 configuration */
  92.   // E0 <-> Byte Mode
  93.   // E1 <-> Word Mode
  94.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1;
  95.   GPIO_Init(GPIOE, &GPIO_InitStructure);
  96.  
  97. /*-- FSMC Configuration ------------------------------------------------------*/
  98.   p.FSMC_AddressSetupTime = 0;
  99.   p.FSMC_AddressHoldTime = 0;
  100.   p.FSMC_DataSetupTime = 2;
  101.   p.FSMC_BusTurnAroundDuration = 0;
  102.   p.FSMC_CLKDivision = 0;
  103.   p.FSMC_DataLatency = 0;
  104.   p.FSMC_AccessMode = FSMC_AccessMode_A;
  105.  
  106.   FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM3;
  107.   FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable;
  108.   FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_SRAM;
  109.   FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;
  110.   FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable;
  111.   FSMC_NORSRAMInitStructure.FSMC_WaitSignalPolarity = FSMC_WaitSignalPolarity_Low;
  112.   FSMC_NORSRAMInitStructure.FSMC_WrapMode = FSMC_WrapMode_Disable;
  113.   FSMC_NORSRAMInitStructure.FSMC_WaitSignalActive = FSMC_WaitSignalActive_BeforeWaitState;
  114.   FSMC_NORSRAMInitStructure.FSMC_WriteOperation = FSMC_WriteOperation_Enable;
  115.   FSMC_NORSRAMInitStructure.FSMC_WaitSignal = FSMC_WaitSignal_Disable;
  116.   FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Disable;
  117.   FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable;
  118.   FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &p;
  119.   FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &p;
  120.  
  121.   FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure);
  122.  
  123.   /* Enable FSMC Bank1_SRAM Bank */
  124.   FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM3, ENABLE);  
  125. }
  126.  
  127. /*******************************************************************************
  128. * Function Name  : FSMC_SRAM_WriteBuffer
  129. * Description    : Writes a Half-word buffer to the FSMC SRAM memory.
  130. * Input          : - pBuffer : pointer to buffer.
  131. *                  - WriteAddr : SRAM memory internal address  which the data
  132. *                    will be written.
  133. *                  - NumHalfwordToWrite : number of half-words to write.
  134. *                    
  135. * Output         : None
  136. * Return         : None
  137. *******************************************************************************/
  138. void FSMC_SRAM_WriteBuffer(u16* pBuffer, u32 WriteAddr, u32 NumHalfwordToWrite)
  139. {
  140.   for(; NumHalfwordToWrite != 0; NumHalfwordToWrite--) /* while there is data to write */
  141.   {
  142.     /* Transfer data to the memory */
  143.     *(u16 *) (Bank1_SRAM3_ADDR + WriteAddr) = *pBuffer++;
  144.    
  145.     /* Increment the address*/  
  146.     WriteAddr += 2;
  147.   }  
  148. }
  149.  
  150. /*******************************************************************************
  151. * Function Name  : FSMC_SRAM_ReadBuffer
  152. * Description    : Reads a block of data  the FSMC SRAM memory.
  153. * Input          : - pBuffer : pointer to the buffer that receives the data read
  154. *                     the SRAM memory.
  155. *                  - ReadAddr : SRAM memory internal address to read .
  156. *                  - NumHalfwordToRead : number of half-words to read.
  157. * Output         : None
  158. * Return         : None
  159. *******************************************************************************/
  160. void FSMC_SRAM_ReadBuffer(u16* pBuffer, u32 ReadAddr, u32 NumHalfwordToRead)
  161. {
  162.   for(; NumHalfwordToRead != 0; NumHalfwordToRead--) /* while there is data to read */
  163.   {
  164.     /* Read a half-word  the memory */
  165.     *pBuffer++ = *(vu16*) (Bank1_SRAM3_ADDR + ReadAddr);
  166.  
  167.     /* Increment the address*/  
  168.     ReadAddr += 2;
  169.   }  
  170. }
  171.  
  172. /******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/


  1. /* Write/read to/ FSMC SRAM memory  *************************************/
  2.   /* Enable the FSMC Clock */
  3.   RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);
  4.  
  5.   // SRAM init
  6.   FSMC_SRAM_Init();
  7.  
  8.   // ezzel probálkozom, ha csak 1 címet akarok írni
  9.   *(u16 *) (((u32)0x68000000) + 0x10) = 0xF11F;
  10.   u16 temp = *(vu16*) (((u32)0x68000000) + 0x10);
  11.  
  12.   /* Write data to FSMC SRAM memory */
  13.   /* Fill the buffer to send */
  14.   Fill_Buffer(TxBuffer, BUFFER_SIZE, 0x00); // Eredménye: 0, 1, 2, 3, 4, 5...1024
  15.   FSMC_SRAM_WriteBuffer(TxBuffer, WRITE_ADDR, BUFFER_SIZE);
  16.  
  17.   /* Read data  FSMC SRAM memory */
  18.   FSMC_SRAM_ReadBuffer(RxBuffer, WRITE_ADDR, BUFFER_SIZE);

Nem igen értem mi lehet a gond.
(#) csatti2 válasza don_peter hozzászólására (») Ápr 1, 2018 /
 
Ha megnézed a kapcsolási rajzot, akkor látszik, hogy az FSMC_NE2-re van kötve az SRAM (nálam az FSMC_NE3-ra volt). Ezért a kódodban rosszul konfigurálod a memóriát.

mindenhol FSMC_Bank1_NORSRAM3 => FSMC_Bank1_NORSRAM2
cím változás 0x68000000 => 0x64000000
és természetesen a PG9-et kell konfigurálni nem pedig a PG10-et.
(#) don_peter válasza csatti2 hozzászólására (») Ápr 1, 2018 /
 
Igen, igazad van, ezt nem vettem észre..
Át írtam G9-re, így az NE2-re került a ChipSelect.

A memória nem tiszta.
Hová kell az mutasson?
Nem értem a felosztást, hogy melyik mire kell mutasson.
(#) csatti2 válasza don_peter hozzászólására (») Ápr 1, 2018 /
 
Nézd meg a mellékelt képet. Látszik rajta, hogy attól függően milyen hardvert csatlakoztatsz az FSMC-n keresztül, különböző memóriacímeken lehet elérni. Az SRAM-ot (és pl. az LCD-t is) a 0x60000000 területre osztja le. Azonban tovább bonyolítja, hogy ezt a területet is 4db 64MB-os részterületre osztja fel, annak függvényében melyik chip select-et használod. Mivel a hardvered az NE2-t használja ezért a memóriád a 0x64000000-os címtől lesz elérhető. Ez azért hasznos, mert akár 4db SRAM-ot (vagy egyéb hardvert) is csatlakoztathatsz egyszerre (sőt, nagy sebességű logikai kapuval és a nem használt address line-ok segítségével még többet is ).
A hozzászólás módosítva: Ápr 1, 2018
(#) don_peter válasza csatti2 hozzászólására (») Ápr 1, 2018 /
 
Igen, rá is varázsoltam, de system halted-re kiáll a program, amikor írni akarok a területre.
Lehet még valami nincs a helyén?

Értem már, a memória elosztást.
(#) csatti2 válasza don_peter hozzászólására (») Ápr 1, 2018 /
 
Milyen memóriád van a vason ténylegesen?
  1. p.FSMC_AddressSetupTime = 3;
  2.   p.FSMC_AddressHoldTime = 0;
  3.   p.FSMC_DataSetupTime = 3;
  4.   p.FSMC_BusTurnAroundDuration = 0;
  5.   p.FSMC_CLKDivision = 0;
  6.   p.FSMC_DataLatency = 0;
  7.   p.FSMC_AccessMode = FSMC_AccessMode_A;


ne legyél az időzítésekkel túl agresszív az elején, később ráérsz belőni.
A hozzászólás módosítva: Ápr 1, 2018
(#) don_peter válasza csatti2 hozzászólására (») Ápr 1, 2018 /
 
CY62157EV30 - Bővebben: Link
Gyárilag ez van rajta.
Éppen most ellenőrzöm a lábkiosztást és a bekötést, hogy minden a helyén van e.
Szerk: a lábak biztosan jó helyen vannak, azt most műszerrel ellenőriztem.
A hozzászólás módosítva: Ápr 1, 2018
(#) csatti2 válasza don_peter hozzászólására (») Ápr 1, 2018 /
 
Ez a memória elég lassú. Azokat az időket növeld meg inkább 5-6-ra. Később esetleg megnézheted 4-el is (gondolom 72MHz-en futsz).
(#) don_peter válasza csatti2 hozzászólására (») Ápr 1, 2018 /
 
Igen, 72MHz-en ketyeg, de a portokat le kellett vennem 10MHz-re mert 50MHz-en már nem volt jó, ennyit észlelek, mint működés.
Lejjebb veszem az időzítéseket.
(#) csatti2 válasza don_peter hozzászólására (») Ápr 1, 2018 /
 
Nekem sosem volt még problémán az 50MHz-es móddal. Viszont ez lehet további időzítési hibát okozhat. Innentől kábé nekem is elfogytak az ötleteim.

Ja igen, még valami. Ne használj -O1-nél nagyobb optimalizációt (bár az IAR-nek gondolom nem GCC alapú a fordítója).
A hozzászólás módosítva: Ápr 1, 2018
(#) don_peter válasza csatti2 hozzászólására (») Ápr 1, 2018 /
 
Ezeket nézegetem akkor, mert szerintem is most már mennie kellene.
Egyelőre nem találom a hibát, az időket már 100-as nagyságrendben állítom, de semmi.
Gondolom csak valami kis dolog, amit megint nem veszek észre, 3 napja kínlódok már vele..
Szeretek egyedül spekuzin a dolgokon, de ez már kicsit kezd sok lenni.

Alapon van az optimalizáció.
A hozzászólás módosítva: Ápr 1, 2018

low.PNG
    
(#) csatti2 válasza don_peter hozzászólására (») Ápr 1, 2018 /
 
Tedd be az aktuális kódot, gyorsan átfutom én is.
(#) don_peter válasza csatti2 hozzászólására (») Ápr 1, 2018 /
 
FSMC:
  1. /******************** (C) COPYRIGHT 2008 STMicroelectronics ********************
  2. * File Name          : fsmc_sram.c
  3. * Author             : MCD Application Team
  4. * Version            : V2.0.3
  5. * Date               : 09/22/2008
  6. * Description        : This file provides a set of functions needed to drive the
  7. *                      IS61WV51216BLL SRAM memory
  8. ********************************************************************************
  9. * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  10. * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
  11. * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
  12. * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
  13. * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
  14. * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  15. *******************************************************************************/
  16.  
  17. /* Includes ------------------------------------------------------------------*/
  18. #include "fsmc_sram.h"
  19.  
  20. /* Private typedef -----------------------------------------------------------*/
  21. /* Private define ------------------------------------------------------------*/
  22. //#define Bank1_SRAM3_ADDR        ((u32)0x60000000)
  23. #define Bank2_SRAM3_ADDR        ((u32)0x64000000)
  24. //#define Bank3_SRAM3_ADDR        ((u32)0x68000000)
  25. //#define Bank4_SRAM3_ADDR        ((u32)0x6C000000)
  26. //#define Bank1_SRAM3_ADDR        ((u32)0x68000000)
  27.  
  28. /* Private macro -------------------------------------------------------------*/
  29. /* Private variables ---------------------------------------------------------*/
  30. /* Private function prototypes -----------------------------------------------*/
  31. /* Private functions ---------------------------------------------------------*/
  32.  
  33. /*******************************************************************************
  34. * Function Name  : FSMC_SRAM_Init
  35. * Description    : Configures the FSMC and GPIOs to interface with the SRAM memory.
  36. *                  This function must be called before any write/read operation
  37. *                  on the SRAM.
  38. * Input          : None
  39. * Output         : None
  40. * Return         : None
  41. *******************************************************************************/
  42. void FSMC_SRAM_Init(void)
  43. {
  44.   FSMC_NORSRAMInitTypeDef  FSMC_NORSRAMInitStructure;
  45.   FSMC_NORSRAMTimingInitTypeDef  p;
  46.   GPIO_InitTypeDef GPIO_InitStructure;
  47.  
  48.   RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD | RCC_APB2Periph_GPIOG | RCC_APB2Periph_GPIOE |
  49.                          RCC_APB2Periph_GPIOF, ENABLE);
  50.  
  51. /*-- GPIO Configuration ------------------------------------------------------*/
  52.   /* SRAM Data lines configuration */
  53.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_8 | GPIO_Pin_9 |
  54.                                 GPIO_Pin_10 | GPIO_Pin_14 | GPIO_Pin_15;
  55.   GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
  56.   GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  57.   GPIO_Init(GPIOD, &GPIO_InitStructure);
  58.  
  59.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7 | GPIO_Pin_8 | GPIO_Pin_9 | GPIO_Pin_10 |
  60.                                 GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14 |
  61.                                 GPIO_Pin_15;
  62.   GPIO_Init(GPIOE, &GPIO_InitStructure);
  63.  
  64.   /* SRAM Address lines configuration */
  65.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 |
  66.                                 GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_12 | GPIO_Pin_13 |
  67.                                 GPIO_Pin_14 | GPIO_Pin_15;
  68.   GPIO_Init(GPIOF, &GPIO_InitStructure);
  69.  
  70.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 |
  71.                                 GPIO_Pin_4 | GPIO_Pin_5;
  72.   GPIO_Init(GPIOG, &GPIO_InitStructure);
  73.  
  74.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11 | GPIO_Pin_12 | GPIO_Pin_13;
  75.   GPIO_Init(GPIOD, &GPIO_InitStructure);
  76.  
  77.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3;
  78.   GPIO_Init(GPIOE, &GPIO_InitStructure);
  79.    
  80.   /* NOE and NWE configuration */  
  81.   // D4 <-> OUTPUT Enabled
  82.   // D5 <-> WRITE Enabled
  83.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4 | GPIO_Pin_5; // 7-es PIN a FAMC_NE1
  84.   GPIO_Init(GPIOD, &GPIO_InitStructure);
  85.  
  86.   /* NE2 configuration */
  87.   // CHIP Select
  88.   // G9 <-> CHIP Select
  89.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;
  90.   GPIO_Init(GPIOG, &GPIO_InitStructure);
  91.  
  92.   /* NBL0, NBL1 configuration */
  93.   // E0 <-> Byte Mode
  94.   // E1 <-> Word Mode
  95.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1;
  96.   GPIO_Init(GPIOE, &GPIO_InitStructure);
  97.  
  98. /*-- FSMC Configuration ------------------------------------------------------*/
  99.   p.FSMC_AddressSetupTime = 5;
  100.   p.FSMC_AddressHoldTime = 0;
  101.   p.FSMC_DataSetupTime = 5;
  102.   p.FSMC_BusTurnAroundDuration = 0;
  103.   p.FSMC_CLKDivision = 0;
  104.   p.FSMC_DataLatency = 0;
  105.   p.FSMC_AccessMode = FSMC_AccessMode_A;
  106.  
  107.   FSMC_NORSRAMInitStructure.FSMC_Bank = FSMC_Bank1_NORSRAM2;
  108.   FSMC_NORSRAMInitStructure.FSMC_DataAddressMux = FSMC_DataAddressMux_Disable;
  109.   FSMC_NORSRAMInitStructure.FSMC_MemoryType = FSMC_MemoryType_SRAM;
  110.   FSMC_NORSRAMInitStructure.FSMC_MemoryDataWidth = FSMC_MemoryDataWidth_16b;
  111.   FSMC_NORSRAMInitStructure.FSMC_BurstAccessMode = FSMC_BurstAccessMode_Disable;
  112.   FSMC_NORSRAMInitStructure.FSMC_WaitSignalPolarity = FSMC_WaitSignalPolarity_Low;
  113.   FSMC_NORSRAMInitStructure.FSMC_WrapMode = FSMC_WrapMode_Disable;
  114.   FSMC_NORSRAMInitStructure.FSMC_WaitSignalActive = FSMC_WaitSignalActive_BeforeWaitState;
  115.   FSMC_NORSRAMInitStructure.FSMC_WriteOperation = FSMC_WriteOperation_Enable;
  116.   FSMC_NORSRAMInitStructure.FSMC_WaitSignal = FSMC_WaitSignal_Disable;
  117.   FSMC_NORSRAMInitStructure.FSMC_ExtendedMode = FSMC_ExtendedMode_Disable;
  118.   FSMC_NORSRAMInitStructure.FSMC_WriteBurst = FSMC_WriteBurst_Disable;
  119.   FSMC_NORSRAMInitStructure.FSMC_ReadWriteTimingStruct = &p;
  120.   FSMC_NORSRAMInitStructure.FSMC_WriteTimingStruct = &p;
  121.  
  122.   FSMC_NORSRAMInit(&FSMC_NORSRAMInitStructure);
  123.  
  124.   /* Enable FSMC Bank2_SRAM Bank */
  125.   FSMC_NORSRAMCmd(FSMC_Bank1_NORSRAM2, ENABLE);  
  126. }
  127.  
  128. /*******************************************************************************
  129. * Function Name  : FSMC_SRAM_WriteBuffer
  130. * Description    : Writes a Half-word buffer to the FSMC SRAM memory.
  131. * Input          : - pBuffer : pointer to buffer.
  132. *                  - WriteAddr : SRAM memory internal address  which the data
  133. *                    will be written.
  134. *                  - NumHalfwordToWrite : number of half-words to write.
  135. *                    
  136. * Output         : None
  137. * Return         : None
  138. *******************************************************************************/
  139. void FSMC_SRAM_WriteBuffer(u16* pBuffer, u32 WriteAddr, u32 NumHalfwordToWrite)
  140. {
  141.   for(; NumHalfwordToWrite != 0; NumHalfwordToWrite--) /* while there is data to write */
  142.   {
  143.     /* Transfer data to the memory */
  144.     *(u16 *) (Bank2_SRAM3_ADDR + WriteAddr) = *pBuffer++;
  145.    
  146.     /* Increment the address*/  
  147.     WriteAddr += 2;
  148.   }  
  149. }
  150.  
  151. /*******************************************************************************
  152. * Function Name  : FSMC_SRAM_ReadBuffer
  153. * Description    : Reads a block of data  the FSMC SRAM memory.
  154. * Input          : - pBuffer : pointer to the buffer that receives the data read
  155. *                     the SRAM memory.
  156. *                  - ReadAddr : SRAM memory internal address to read .
  157. *                  - NumHalfwordToRead : number of half-words to read.
  158. * Output         : None
  159. * Return         : None
  160. *******************************************************************************/
  161. void FSMC_SRAM_ReadBuffer(u16* pBuffer, u32 ReadAddr, u32 NumHalfwordToRead)
  162. {
  163.   for(; NumHalfwordToRead != 0; NumHalfwordToRead--) /* while there is data to read */
  164.   {
  165.     /* Read a half-word  the memory */
  166.     *pBuffer++ = *(vu16*) (Bank2_SRAM3_ADDR + ReadAddr);
  167.  
  168.     /* Increment the address*/  
  169.     ReadAddr += 2;
  170.   }  
  171. }
  172.  
  173. /******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/


Main()
  1. /*************************************************************************
  2.  *
  3.  *    DPTP System 2018-03-30
  4.  *    SRAM
  5.  *
  6.  *    Revision: 1.0
  7.  **************************************************************************/
  8. #include "includes.h"
  9.  
  10. #define DLY_100US  450
  11.  
  12. #define BUFFER_SIZE    8
  13. #define WRITE_ADDR     0
  14. u16 TxBuffer[BUFFER_SIZE];
  15. u16 RxBuffer[BUFFER_SIZE];
  16.  
  17. /* Private function prototypes -----------------------------------------------*/
  18. void Fill_Buffer(u16 *pBuffer, u16 BufferLenght, u32 Offset);
  19.  
  20. void main(void){
  21.   GPIO_InitTypeDef GPIO_InitStructure;  // IO struktúra
  22.   unsigned int i = 0;
  23.  
  24.   ENTR_CRT_SECTION();
  25.  
  26.   /* Setup STM32 system (clock, PLL and Flash configuration) */
  27.   SystemInit();
  28.  
  29.     // NVIC init
  30.   #ifndef  EMB_FLASH
  31.     /* Set the Vector Table base location at 0x20000000 */
  32.     NVIC_SetVectorTable(NVIC_VectTab_RAM, 0x0);
  33.   #else  /* VECT_TAB_FLASH  */
  34.     /* Set the Vector Table base location at 0x08000000 */
  35.     NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x0);
  36.   #endif
  37.     NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4);
  38.  
  39.   EXT_CRT_SECTION();
  40.  
  41.   // F prot beállítása (LED)
  42.   RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOF, ENABLE);
  43.   //RCC_APB2PeriphResetCmd(RCC_APB2Periph_GPIOF, DISABLE);
  44.   GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  45.   GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
  46.   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;
  47.   GPIO_Init(GPIOF, &GPIO_InitStructure);
  48.  
  49.   /* Write/read to/ FSMC SRAM memory  *************************************/
  50.   /* Enable the FSMC Clock */
  51.   RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);
  52.  
  53.   // SRAM init
  54.   FSMC_SRAM_Init();
  55.  
  56.   //*(u16 *) ((u32)0x64000000 + 0x10) = 0xF11F;
  57.   //u16 temp = *(vu16*) ((u32)0x64000000 + 0x10);
  58.  
  59.   /* Write data to FSMC SRAM memory */
  60.   /* Fill the buffer to send */
  61.   Fill_Buffer(TxBuffer, BUFFER_SIZE, 0xFF00);
  62.   FSMC_SRAM_WriteBuffer(TxBuffer, WRITE_ADDR, BUFFER_SIZE);
  63.  
  64.   /* Read data  FSMC SRAM memory */
  65.   FSMC_SRAM_ReadBuffer(RxBuffer, WRITE_ADDR, BUFFER_SIZE);
  66.    
  67.     while(1){
  68.      
  69.       // LED-et villogtatok, hogy lássam fut a program
  70.       if((i & 0xFFFFF) == 0){
  71.         if((GPIOF->IDR & GPIO_Pin_6) != 0){
  72.           GPIOF->BRR = GPIO_Pin_6;
  73.         }else{
  74.           GPIOF->BSRR = GPIO_Pin_6;
  75.         }
  76.         i=0;
  77.       }
  78.       i++;
  79.     }// while
  80.  
  81. }// main
  82.  
  83. void Fill_Buffer(u16 *pBuffer, u16 BufferLenght, u32 Offset)
  84. {
  85.   u16 IndexTmp = 0;
  86.  
  87.   /* Put in global buffer same values */
  88.   for (IndexTmp = 0; IndexTmp < BufferLenght; IndexTmp++ )
  89.   {
  90.     pBuffer[IndexTmp] = IndexTmp + Offset;
  91.   }
  92. }

Ez a full kód.
(#) csatti2 válasza don_peter hozzászólására (») Ápr 1, 2018 /
 
Hmm, az RCC_APB2Periph_AFIO-t bekapcsolod valahol?
(#) don_peter válasza csatti2 hozzászólására (») Ápr 1, 2018 /
 
Szerintem nem, de utána nézek.. Nem is ismerős..
Nincs ilyen.
Hová érdemes beilleszteni a kódba?

Közben megtaláltam a FSMC init résznél az első Port initnél.
A hozzászólás módosítva: Ápr 1, 2018
(#) csatti2 válasza don_peter hozzászólására (») Ápr 1, 2018 /
 
Hát, enélkül nem mennek az AFIO alapú perifériák... (azaz kb. minden)
(#) csatti2 válasza don_peter hozzászólására (») Ápr 1, 2018 /
 
Az én példámban az elején volt.

  1. RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD | RCC_APB2Periph_GPIOE | RCC_APB2Periph_GPIOF |
  2.                          RCC_APB2Periph_GPIOG | RCC_APB2Periph_AFIO, ENABLE);
Következő: »»   115 / 176
Bejelentkezés

Belépés

Hirdetés
Lapoda.hu     XDT.hu     HEStore.hu
Az oldalon sütiket használunk a helyes működéshez. Bővebb információt az adatvédelmi szabályzatban olvashatsz. Megértettem