stm32fxx_STUclassBvar.h 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* Define to prevent recursive inclusion -------------------------------------*/
  2. #ifndef __STL_CLASS_B_VAR_H
  3. #define __STL_CLASS_B_VAR_H
  4. #include "stm32f1xx_hal.h"
  5. #include "stm32fxx_STUparam.h"
  6. /* This avoids having multiply defined global variables */
  7. #ifdef ALLOC_GLOBALS
  8. #define EXTERN
  9. #else
  10. #define EXTERN extern
  11. #endif
  12. #ifdef __CC_ARM /* KEIL Compiler */
  13. /* RAM location for temporary storage of original values at run time RAM transparent test */
  14. EXTERN uint32_t aRunTimeRamBuf[RT_RAM_BLOCKSIZE + 2] __attribute__((section("RUN_TIME_RAM_BUF")));
  15. /* RAM pointer for run-time tests */
  16. EXTERN uint32_t *pRunTimeRamChk __attribute__((section("RUN_TIME_RAM_PNT")));
  17. EXTERN uint32_t *pRunTimeRamChkInv __attribute__((section("RUN_TIME_RAM_PNT")));
  18. EXTERN uint32_t aGAP_FOR_RAM_TEST_OVERLAY[2] __attribute__((section("RUN_TIME_RAM_PNT")));
  19. /* Note: the zero_init forces the linker to place variables in the bss section */
  20. /* This allows the UNINIT directive (in scatter file) to work. On the contrary */
  21. /* all Class B variables pairs should be initialized properly by user before using them */
  22. /* Counter for verifying correct program execution at start */
  23. EXTERN uint32_t CtrlFlowCnt __attribute__((section("CLASS_B_RAM"), zero_init));
  24. EXTERN uint32_t CtrlFlowCntInv __attribute__((section("CLASS_B_RAM_REV"), zero_init));
  25. /* Counter for verifying correct program execution in interrupt */
  26. EXTERN uint32_t ISRCtrlFlowCnt __attribute__((section("CLASS_B_RAM"), zero_init));
  27. EXTERN uint32_t ISRCtrlFlowCntInv __attribute__((section("CLASS_B_RAM_REV"), zero_init));
  28. /* LSI period measurement at TIM5 IRQHandler */
  29. EXTERN uint32_t PeriodValue __attribute__((section("CLASS_B_RAM"), zero_init));
  30. EXTERN uint32_t PeriodValueInv __attribute__((section("CLASS_B_RAM_REV"), zero_init));
  31. /* Sofware time base used in main program (incremented in SysTick timer ISR */
  32. EXTERN uint32_t TickCounter __attribute__((section("CLASS_B_RAM"), zero_init));
  33. EXTERN uint32_t TickCounterInv __attribute__((section("CLASS_B_RAM_REV"), zero_init));
  34. /* Indicates to the main routine a 100ms tick */
  35. EXTERN __IO uint32_t TimeBaseFlag __attribute__((section("CLASS_B_RAM"), zero_init));
  36. EXTERN __IO uint32_t TimeBaseFlagInv __attribute__((section("CLASS_B_RAM_REV"), zero_init));
  37. /* Indicates to the main routine a 100ms tick */
  38. EXTERN __IO uint32_t LSIPeriodFlag __attribute__((section("CLASS_B_RAM"), zero_init));
  39. EXTERN __IO uint32_t LSIPeriodFlagInv __attribute__((section("CLASS_B_RAM_REV"), zero_init));
  40. /* Stores the Control flow counter from one main loop to the other */
  41. EXTERN uint32_t LastCtrlFlowCnt __attribute__((section("CLASS_B_RAM"), zero_init));
  42. EXTERN uint32_t LastCtrlFlowCntInv __attribute__((section("CLASS_B_RAM_REV"), zero_init));
  43. /* Pointer to FLASH for crc32 run-time tests */
  44. EXTERN uint32_t *pRunCrc32Chk __attribute__((section("CLASS_B_RAM"), zero_init));
  45. EXTERN uint32_t *pRunCrc32ChkInv __attribute__((section("CLASS_B_RAM_REV"), zero_init));
  46. /* Reference 32-bit CRC for run-time tests */
  47. EXTERN uint32_t RefCrc32 __attribute__((section("CLASS_B_RAM"), zero_init));
  48. EXTERN uint32_t RefCrc32Inv __attribute__((section("CLASS_B_RAM_REV"), zero_init));
  49. /* Magic pattern for Stack overflow in this array */
  50. EXTERN __IO uint32_t aStackOverFlowPtrn[4] __attribute__((section("STACK_BOTTOM"), zero_init));
  51. #endif /* __CC_ARM */
  52. #endif /* __STL_CLASS_B_VAR_H */
  53. //uint32_t CtrlFlowCnt ;
  54. /********************END OF FILE************************************/