Monthly Archives: May 2021

Lenovo ThinkCenter M71

Maybe

Windows 10 Shutdown (Power-off) Issue
ThinkCentre M71e won’t shutdown after Windows 10 Upgrade

 1. Boot from the Windows 10 install media
 2. After booting to the UEFI device you see the Install Windows 10 screen, press Shift + F10 to open a command prompt.
 3. Type Diskpart, press Enter
 4. Type List Disk , press Enter
 5. Type Select Disk # (where # is the number your drive shows up as), press Enter
 6. Type Clean, press Enter
 7. Type Convert GPT, press Enter
 8. Type Exit, press Enter.
 9. Close the Command Prompt window.
 10. Click the "Next" button.
 11. Click the "Install now" button

Not working!

powermgr.exe hibernate off

Fix: Lenovo is not shutting down (Lenovo Laptop, Desktop does not turn off)

STM32duino SysTick

STM32G071RB


Twice initialization


Code

  • HAL_Init():
    SystemCoreClock = 16'000'000 Hz = 16 MHz
  • SystemClock_Config():
    SystemCoreClock = 64'000'000 Hz = 64 MHz
#ifndef F_CPU
  #define F_CPU SystemCoreClock
#endif
void hw_config_init(void)
{
  /* Initialize the HAL */
  HAL_Init();

  /* Configure the system clock */
  SystemClock_Config();
}
/* The SystemCoreClock variable is updated in three ways:
    1) by calling CMSIS function SystemCoreClockUpdate()
    2) by calling HAL API function HAL_RCC_GetHCLKFreq()
    3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
       Note: If you use this function to configure the system clock; then there
             is no need to call the 2 first functions listed above, since SystemCoreClock
             variable is updated automatically.
*/
uint32_t SystemCoreClock = 16000000UL;
HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t FLatency)
{
  [...]

  /* Update the SystemCoreClock global variable */
  SystemCoreClock = (HAL_RCC_GetSysClockFreq() >> ((AHBPrescTable[(RCC->CFGR & RCC_CFGR_HPRE) >> RCC_CFGR_HPRE_Pos]) & 0x1FU));

  /* Configure the source of time base considering new system clocks settings*/
  return HAL_InitTick(uwTickPrio);
}
void noOsSystickHandler() { } // empty

void osSystickHandler() __attribute__((weak, alias("noOsSystickHandler")));
void SysTick_Handler(void)
{
  HAL_IncTick();
  HAL_SYSTICK_IRQHandler();
  osSystickHandler();
}