The photos are not very beautiful to me, but I read from the HK32F030MF4P6 housing, and below the series, probably 07S36170 (these S3 are uncertain, the rest at 95%).
A voltmeter applied between ground and VCAP shows about 0.7 V. It shows the same between Vdd and VCAP, so I conclude that the VCAP is hanging. After setting PD7 as the output, I have state changes on VCAP - voltage 0 and Vdd alternately..
After programming the NRST, the system does not respond to a short-circuit of the NRST to ground. After programming PA0 as an output, it changes state. I am attaching the program source and .hex.
Now I'm going for the HK32F030MJ4M6.
[syntax=c]#include "hk32f030m.h"
#include "stm32yyyy.h"
#include "stm32util.h"
#define HCLK_FREQ 32000000u
#define LED_FREQ 400
#define LED_STEPS 250
#define LED_DIM 1
#define PWM_TIM TIM1
#define LED_DUTY PWM_TIM->CCR4
// AF3 - TIM1, AF4 - TIM2
// PC4 - pin 7 (6?) -> TIM1CH
// pin 1 - PD4 TIM1CH4, TIM2CH1
#define LED_PORT GPIOD
#define LED_BIT 4
#define LED_MASK (1u AHBENR |= RCC_AHBENR_GPIOAEN | RCC_AHBENR_GPIOBEN
| RCC_AHBENR_GPIOCEN | RCC_AHBENR_GPIODEN;
RCC->APB2ENR = RCC_APB2ENR_TIM1EN;
RCC->APB1ENR = RCC_APB1ENR_TIM2EN | RCC_APB1ENR_IOMUXEN;
PWM_TIM->PSC = HCLK_FREQ / LED_FREQ / LED_STEPS - 1;
PWM_TIM->ARR = LED_STEPS - 1;
PWM_TIM->CCMR1 = TIM_CCMR1_OC1M_PWM1 | TIM_CCMR1_OC1PE | TIM_CCMR1_OC2M_PWM1 | TIM_CCMR1_OC2PE;
PWM_TIM->CCMR2 = TIM_CCMR2_OC3M_PWM1 | TIM_CCMR2_OC3PE | TIM_CCMR2_OC4M_PWM1 | TIM_CCMR2_OC4PE;
PWM_TIM->CCER = TIM_CCER_CC1E | TIM_CCER_CC2E | TIM_CCER_CC3E | TIM_CCER_CC4E;
PWM_TIM->BDTR = TIM_BDTR_MOE;
PWM_TIM->CR1 = TIM_CR1_CEN;
LED_PORT->AFR[0] |= BF4(LED_BIT, 3);
LED_PORT->MODER &= BF2A(LED_BIT, GPIO_MODER_AF);
SysTick_Config(HCLK_FREQ / 1000);
for (;
__WFI();
}
void SysTick_Handler(void);
void SysTick_Handler(void)
{
static uint8_t led_target = LED_DIM;
static uint16_t tdiv;
if (++tdiv == 1000)
{
tdiv = 0;
//LED_PORT->BSRR = LED_MASK ODR & LED_MASK);
// toggle PD7
GPIOD->BSRR = (1u