Forum: Mikrocontroller und Digitale Elektronik stm8 springt in NonHandledInterrupt


von µC8051 (Gast)


Lesenswert?

Hallo zusammen,

ich habe für meinen STM8S105K6 Board ein kleines Echo Programm 
gebastelt. Die beiden Pins für die UART2 sind aktuell kuzrgeschlossen 
(später soll hier eine Single wire UART realisiert werden). Daher gehe 
ich davon aus, dass wenn ich was an TX sende, es an RX wieder empfangen 
wird. Also müsste mein Programm endlos nachrichten hin und her schicken. 
Leider springt nach dem ersten Senden (Senden erfolgt mit Oszi 
kontrolliert) das Programm nicht in den Interrupt  "@far @interrupt void 
UART2_RX_IRQHandler(void)" sondern in "@far @interrupt void 
NonHandledInterrupt(void)" und dort bleibt das Programm dann stehen.

Aber wodurch wird dies ausgelöst.


main.c
1
/* Includes ------------------------------------------------------------------*/
2
#include "stm8s.h"
3
4
/* Private typedef -----------------------------------------------------------*/
5
/* Private define ------------------------------------------------------------*/
6
/* Private macro -------------------------------------------------------------*/
7
/* Private variables ---------------------------------------------------------*/
8
/* Private function prototypes -----------------------------------------------*/
9
static void CLK_Config(void);
10
static void UART_Config(void);
11
/* Private functions ---------------------------------------------------------*/
12
13
void main(void)
14
{
15
  /* CLK configuration -----------------------------------------*/
16
  CLK_Config();
17
18
  // IC-Driver off
19
  GPIO_Init(GPIOD, GPIO_PIN_2, GPIO_MODE_OUT_OD_LOW_FAST);
20
  GPIO_WriteHigh(GPIOD, GPIO_PIN_2);
21
  
22
  GPIO_Init(GPIOD, GPIO_PIN_0, GPIO_MODE_OUT_PP_LOW_FAST);
23
  GPIO_WriteLow(GPIOD, (GPIO_PIN_0));
24
  
25
  /* UART configuration -----------------------------------------*/
26
  UART_Config();  
27
  UART2_SendData8(0xAA);
28
  
29
  while(1){
30
  }
31
}
32
33
static void CLK_Config(void)
34
{
35
    /* Initialization of the clock */
36
    /* Clock divider to HSI/1 */
37
    CLK_HSIPrescalerConfig(CLK_PRESCALER_HSIDIV1);
38
}
39
40
41
static void UART_Config(void)
42
{
43
  /* Deinitializes the UART2 */
44
    UART2_DeInit();
45
46
    /* UART2 configuration -------------------------------------------------*/
47
    /* UART2 configured as follow:
48
          - BaudRate = 115200 baud  
49
          - Word Length = 8 Bits
50
          - One Stop Bit
51
          - No parity
52
          - Receive and transmit enabled
53
          - UART1 Clock disabled
54
     */
55
    /* Configure the UART1 */
56
    UART2_Init((u32)115200, UART2_WORDLENGTH_8D, UART2_STOPBITS_1, UART2_PARITY_NO,
57
                UART2_SYNCMODE_CLOCK_DISABLE, UART2_MODE_TXRX_ENABLE);
58
    
59
    /* Enable UART2 Receive interrupt*/
60
    UART2_ITConfig(UART2_IT_RXNE_OR, ENABLE);
61
62
    /* Enable general interrupts */
63
    enableInterrupts();    
64
}


stm8s_it.c
1
/* Includes ------------------------------------------------------------------*/
2
#include "stm8s_it.h"
3
4
/* Private typedef -----------------------------------------------------------*/
5
/* Private define ------------------------------------------------------------*/
6
/* Private macro -------------------------------------------------------------*/
7
/* Private variables ---------------------------------------------------------*/
8
/* Private function prototypes -----------------------------------------------*/
9
/* Private functions ---------------------------------------------------------*/
10
/* Public functions ----------------------------------------------------------*/
11
12
/** @addtogroup IT_Functions
13
  * @{
14
  */
15
#ifdef _COSMIC_
16
/**
17
  * @brief Dummy interrupt routine
18
  * @par Parameters:
19
  * None
20
  * @retval
21
  * None
22
*/
23
@far @interrupt void NonHandledInterrupt(void)
24
{
25
  /* In order to detect unexpected events during development,
26
     it is recommended to set a breakpoint on the following instruction.
27
  */
28
}
29
30
/**
31
  * @brief TRAP interrupt routine
32
  * @par Parameters:
33
  * None
34
  * @retval
35
  * None
36
*/
37
@far @interrupt void TRAP_IRQHandler(void)
38
{
39
  /* In order to detect unexpected events during development,
40
     it is recommended to set a breakpoint on the following instruction.
41
  */
42
}
43
#else /*_RAISONANCE_*/
44
45
/**
46
  * @brief TRAP interrupt routine
47
  * @par Parameters:
48
  * None
49
  * @retval
50
  * None
51
*/
52
void TRAP_IRQHandler(void) trap
53
{
54
  /* In order to detect unexpected events during development,
55
     it is recommended to set a breakpoint on the following instruction.
56
  */
57
}
58
#endif /*_COSMIC_*/
59
60
/**
61
  * @brief Top Level Interrupt Interruption routine.
62
  * @par Parameters:
63
  * None
64
  * @retval
65
  * None
66
*/
67
#ifdef _COSMIC_
68
@far @interrupt void TLI_IRQHandler(void)
69
#else /* _RAISONANCE_ */
70
void TLI_IRQHandler(void) interrupt 0
71
#endif /* _COSMIC_ */
72
{
73
  /* In order to detect unexpected events during development,
74
     it is recommended to set a breakpoint on the following instruction.
75
  */
76
}
77
78
/**
79
  * @brief Auto Wake Up Interruption routine.
80
  * @par Parameters:
81
  * None
82
  * @retval
83
  * None
84
*/
85
#ifdef _COSMIC_
86
@far @interrupt void AWU_IRQHandler(void)
87
#else /* _RAISONANCE_ */
88
void AWU_IRQHandler(void) interrupt 1
89
#endif /* _COSMIC_ */
90
{
91
  /* In order to detect unexpected events during development,
92
     it is recommended to set a breakpoint on the following instruction.
93
  */
94
}
95
96
/**
97
  * @brief Clock Controller Interruption routine.
98
  * @par Parameters:
99
  * None
100
  * @retval
101
  * None
102
*/
103
#ifdef _COSMIC_
104
@far @interrupt void CLK_IRQHandler(void)
105
#else /* _RAISONANCE_ */
106
void CLK_IRQHandler(void) interrupt 2
107
#endif /* _COSMIC_ */
108
{
109
  /* In order to detect unexpected events during development,
110
     it is recommended to set a breakpoint on the following instruction.
111
  */
112
}
113
114
/**
115
  * @brief External Interrupt PORTA Interruption routine.
116
  * @par Parameters:
117
  * None
118
  * @retval
119
  * None
120
*/
121
#ifdef _COSMIC_
122
@far @interrupt void EXTI_PORTA_IRQHandler(void)
123
#else /* _RAISONANCE_ */
124
void EXTI_PORTA_IRQHandler(void) interrupt 3
125
#endif /* _COSMIC_ */
126
{
127
  /* In order to detect unexpected events during development,
128
     it is recommended to set a breakpoint on the following instruction.
129
  */
130
}
131
132
/**
133
  * @brief External Interrupt PORTB Interruption routine.
134
  * @par Parameters:
135
  * None
136
  * @retval
137
  * None
138
*/
139
#ifdef _COSMIC_
140
@far @interrupt void EXTI_PORTB_IRQHandler(void)
141
#else /* _RAISONANCE_ */
142
void EXTI_PORTB_IRQHandler(void) interrupt 4
143
#endif /* _COSMIC_ */
144
{
145
  /* In order to detect unexpected events during development,
146
     it is recommended to set a breakpoint on the following instruction.
147
  */
148
}
149
150
/**
151
  * @brief External Interrupt PORTC Interruption routine.
152
  * @par Parameters:
153
  * None
154
  * @retval
155
  * None
156
*/
157
#ifdef _COSMIC_
158
@far @interrupt void EXTI_PORTC_IRQHandler(void)
159
#else /* _RAISONANCE_ */
160
void EXTI_PORTC_IRQHandler(void) interrupt 5
161
#endif /* _COSMIC_ */
162
{
163
  /* In order to detect unexpected events during development,
164
     it is recommended to set a breakpoint on the following instruction.
165
  */
166
}
167
168
/**
169
  * @brief External Interrupt PORTD Interruption routine.
170
  * @par Parameters:
171
  * None
172
  * @retval
173
  * None
174
*/
175
#ifdef _COSMIC_
176
@far @interrupt void EXTI_PORTD_IRQHandler(void)
177
#else /* _RAISONANCE_ */
178
void EXTI_PORTD_IRQHandler(void) interrupt 6
179
#endif /* _COSMIC_ */
180
{
181
  /* In order to detect unexpected events during development,
182
     it is recommended to set a breakpoint on the following instruction.
183
  */
184
}
185
186
/**
187
  * @brief External Interrupt PORTE Interruption routine.
188
  * @par Parameters:
189
  * None
190
  * @retval
191
  * None
192
*/
193
#ifdef _COSMIC_
194
@far @interrupt void EXTI_PORTE_IRQHandler(void)
195
#else /* _RAISONANCE_ */
196
void EXTI_PORTE_IRQHandler(void) interrupt 7
197
#endif /* _COSMIC_ */
198
{
199
  /* In order to detect unexpected events during development,
200
     it is recommended to set a breakpoint on the following instruction.
201
  */
202
}
203
#ifdef STM8S903
204
/**
205
  * @brief External Interrupt PORTF Interruption routine.
206
  * @par Parameters:
207
  * None
208
  * @retval
209
  * None
210
*/
211
#ifdef _COSMIC_
212
@far @interrupt void EXTI_PORTF_IRQHandler(void)
213
#else /* _RAISONANCE_ */
214
void EXTI_PORTF_IRQHandler(void) interrupt 8
215
#endif /* _COSMIC_ */
216
{
217
  /* In order to detect unexpected events during development,
218
     it is recommended to set a breakpoint on the following instruction.
219
  */
220
}
221
#endif /*STM8S903*/
222
223
#ifdef STM8S208
224
/**
225
  * @brief CAN RX Interruption routine.
226
  * @par Parameters:
227
  * None
228
  * @retval
229
  * None
230
*/
231
#ifdef _COSMIC_
232
@far @interrupt void CAN_RX_IRQHandler(void)
233
#else /* _RAISONANCE_ */
234
void CAN_RX_IRQHandler(void) interrupt 8
235
#endif /* _COSMIC_ */
236
{
237
  /* In order to detect unexpected events during development,
238
     it is recommended to set a breakpoint on the following instruction.
239
  */
240
}
241
242
/**
243
  * @brief CAN TX Interruption routine.
244
  * @par Parameters:
245
  * None
246
  * @retval
247
  * None
248
*/
249
#ifdef _COSMIC_
250
@far @interrupt void CAN_TX_IRQHandler(void)
251
#else /* _RAISONANCE_ */
252
void CAN_TX_IRQHandler(void) interrupt 9
253
#endif /* _COSMIC_ */
254
{
255
  /* In order to detect unexpected events during development,
256
     it is recommended to set a breakpoint on the following instruction.
257
  */
258
}
259
#endif /*STM8S208*/
260
261
/**
262
  * @brief SPI Interruption routine.
263
  * @par Parameters:
264
  * None
265
  * @retval
266
  * None
267
*/
268
#ifdef _COSMIC_
269
@far @interrupt void SPI_IRQHandler(void)
270
#else /* _RAISONANCE_ */
271
void SPI_IRQHandler(void) interrupt 10
272
#endif /* _COSMIC_ */
273
{
274
  /* In order to detect unexpected events during development,
275
     it is recommended to set a breakpoint on the following instruction.
276
  */
277
}
278
279
/**
280
  * @brief Timer1 Update/Overflow/Trigger/Break Interruption routine.
281
  * @par Parameters:
282
  * None
283
  * @retval
284
  * None
285
*/
286
#ifdef _COSMIC_
287
@far @interrupt void TIM1_UPD_OVF_TRG_BRK_IRQHandler(void)
288
#else /* _RAISONANCE_ */
289
void TIM1_UPD_OVF_TRG_BRK_IRQHandler(void) interrupt 11
290
#endif /* _COSMIC_ */
291
{
292
  /* In order to detect unexpected events during development,
293
     it is recommended to set a breakpoint on the following instruction.
294
  */
295
}
296
297
/**
298
  * @brief Timer1 Capture/Compare Interruption routine.
299
  * @par Parameters:
300
  * None
301
  * @retval
302
  * None
303
*/
304
#ifdef _COSMIC_
305
@far @interrupt void TIM1_CAP_COM_IRQHandler(void)
306
#else /* _RAISONANCE_ */
307
void TIM1_CAP_COM_IRQHandler(void) interrupt 12
308
#endif /* _COSMIC_ */
309
{
310
  /* In order to detect unexpected events during development,
311
     it is recommended to set a breakpoint on the following instruction.
312
  */
313
}
314
315
#ifdef STM8S903
316
/**
317
  * @brief Timer5 Update/Overflow/Break/Trigger Interruption routine.
318
  * @par Parameters:
319
  * None
320
  * @retval
321
  * None
322
*/
323
#ifdef _COSMIC_
324
@far @interrupt void TIM5_UPD_OVF_BRK_TRG_IRQHandler(void)
325
#else /* _RAISONANCE_ */
326
void TIM5_UPD_OVF_BRK_TRG_IRQHandler(void) interrupt 13
327
#endif /* _COSMIC_ */
328
{
329
  /* In order to detect unexpected events during development,
330
     it is recommended to set a breakpoint on the following instruction.
331
  */
332
}
333
/**
334
  * @brief Timer5 Capture/Compare Interruption routine.
335
  * @par Parameters:
336
  * None
337
  * @retval
338
  * None
339
*/
340
#ifdef _COSMIC_
341
@far @interrupt void TIM5_CAP_COM_IRQHandler(void)
342
#else /* _RAISONANCE_ */
343
void TIM5_CAP_COM_IRQHandler(void) interrupt 14
344
#endif /* _COSMIC_ */
345
{
346
  /* In order to detect unexpected events during development,
347
     it is recommended to set a breakpoint on the following instruction.
348
  */
349
}
350
351
#else /*STM8S208, STM8S207, STM8S105 or STM8S103*/
352
/**
353
  * @brief Timer2 Update/Overflow/Break Interruption routine.
354
  * @par Parameters:
355
  * None
356
  * @retval
357
  * None
358
*/
359
#ifdef _COSMIC_
360
@far @interrupt void TIM2_UPD_OVF_BRK_IRQHandler(void)
361
#else /* _RAISONANCE_ */
362
void TIM2_UPD_OVF_BRK_IRQHandler(void) interrupt 13
363
#endif /* _COSMIC_ */
364
{
365
  /* In order to detect unexpected events during development,
366
     it is recommended to set a breakpoint on the following instruction.
367
  */
368
}
369
370
/**
371
  * @brief Timer2 Capture/Compare Interruption routine.
372
  * @par Parameters:
373
  * None
374
  * @retval
375
  * None
376
*/
377
#ifdef _COSMIC_
378
@far @interrupt void TIM2_CAP_COM_IRQHandler(void)
379
#else /* _RAISONANCE_ */
380
void TIM2_CAP_COM_IRQHandler(void) interrupt 14
381
#endif /* _COSMIC_ */
382
{
383
  /* In order to detect unexpected events during development,
384
     it is recommended to set a breakpoint on the following instruction.
385
  */
386
}
387
#endif /*STM8S903*/
388
389
#if defined (STM8S208) || defined(STM8S207) || defined(STM8S105)
390
/**
391
  * @brief Timer3 Update/Overflow/Break Interruption routine.
392
  * @par Parameters:
393
  * None
394
  * @retval
395
  * None
396
*/
397
#ifdef _COSMIC_
398
@far @interrupt void TIM3_UPD_OVF_BRK_IRQHandler(void)
399
#else /* _RAISONANCE_ */
400
void TIM3_UPD_OVF_BRK_IRQHandler(void) interrupt 15
401
#endif /* _COSMIC_ */
402
{
403
  /*   In order to detect unexpected events during development,
404
      it is recommended to set a breakpoint on the following instruction.
405
  */
406
}
407
408
/**
409
  * @brief Timer3 Capture/Compare Interruption routine.
410
  * @par Parameters:
411
  * None
412
  * @retval
413
  * None
414
*/
415
#ifdef _COSMIC_
416
@far @interrupt void TIM3_CAP_COM_IRQHandler(void)
417
#else /* _RAISONANCE_ */
418
void TIM3_CAP_COM_IRQHandler(void) interrupt 16
419
#endif /* _COSMIC_ */
420
{
421
 
422
}
423
#endif /*STM8S208, STM8S207 or STM8S105*/
424
425
#ifndef STM8S105
426
/**
427
  * @brief UART1 TX Interruption routine.
428
  * @par Parameters:
429
  * None
430
  * @retval
431
  * None
432
*/
433
#ifdef _COSMIC_
434
@far @interrupt void UART1_TX_IRQHandler(void)
435
#else /* _RAISONANCE_ */
436
void UART1_TX_IRQHandler(void) interrupt 17
437
#endif /* _COSMIC_ */
438
{
439
  /*   In order to detect unexpected events during development,
440
      it is recommended to set a breakpoint on the following instruction.
441
  */
442
}
443
444
/**
445
  * @brief UART1 RX Interruption routine.
446
  * @par Parameters:
447
  * None
448
  * @retval
449
  * None
450
*/
451
#ifdef _COSMIC_
452
@far @interrupt void UART1_RX_IRQHandler(void)
453
#else /* _RAISONANCE_ */
454
void UART1_RX_IRQHandler(void) interrupt 18
455
#endif /* _COSMIC_ */
456
{
457
  /*   In order to detect unexpected events during development,
458
      it is recommended to set a breakpoint on the following instruction.
459
  */
460
}
461
#endif /*STM8S105*/
462
463
/**
464
  * @brief I2C Interruption routine.
465
  * @par Parameters:
466
  * None
467
  * @retval
468
  * None
469
*/
470
#ifdef _COSMIC_
471
@far @interrupt void I2C_IRQHandler(void)
472
#else /* _RAISONANCE_ */
473
void I2C_IRQHandler(void) interrupt 19
474
#endif /* _COSMIC_ */
475
{
476
  /* In order to detect unexpected events during development,
477
     it is recommended to set a breakpoint on the following instruction.
478
  */
479
}
480
481
#ifdef STM8S105
482
/**
483
  * @brief UART2 TX interrupt routine.
484
  * @par Parameters:
485
  * None
486
  * @retval
487
  * None
488
*/
489
#ifdef _COSMIC_
490
@far @interrupt void UART2_TX_IRQHandler(void)
491
#else /* _RAISONANCE_ */
492
void UART2_TX_IRQHandler(void) interrupt 20
493
#endif /* _COSMIC_ */
494
{
495
  /* In order to detect unexpected events during development,
496
     it is recommended to set a breakpoint on the following instruction.
497
  */  
498
}
499
500
/**
501
  * @brief UART2 RX interrupt routine.
502
  * @par Parameters:
503
  * None
504
  * @retval
505
  * None
506
*/
507
#ifdef _COSMIC_
508
@far @interrupt void UART2_RX_IRQHandler(void)
509
#else /* _RAISONANCE_ */
510
void UART2_RX_IRQHandler(void) interrupt 21
511
#endif /* _COSMIC_ */
512
{
513
  u8 Wert=0;
514
  
515
  Wert = UART2_ReceiveData8();
516
  UART2_SendData8(Wert);
517
  
518
  // UART2_ITConfig(UART2_IT_RXNE_OR, DISABLE);
519
}
520
#endif /* STM8S105*/
521
522
#if defined(STM8S207) || defined(STM8S208)
523
/**
524
  * @brief UART3 TX interrupt routine.
525
  * @par Parameters:
526
  * None
527
  * @retval
528
  * None
529
*/
530
#ifdef _COSMIC_
531
@far @interrupt void UART3_TX_IRQHandler(void)
532
#else /* _RAISONANCE_ */
533
void UART3_TX_IRQHandler(void) interrupt 20
534
#endif /* _COSMIC_ */
535
{
536
    /* In order to detect unexpected events during development,
537
       it is recommended to set a breakpoint on the following instruction.
538
    */
539
  }
540
541
/**
542
  * @brief UART3 RX interrupt routine.
543
  * @par Parameters:
544
  * None
545
  * @retval
546
  * None
547
*/
548
#ifdef _COSMIC_
549
@far @interrupt void UART3_RX_IRQHandler(void)
550
#else /* _RAISONANCE_ */
551
void UART3_RX_IRQHandler(void) interrupt 21
552
#endif /* _COSMIC_ */
553
{
554
    /* In order to detect unexpected events during development,
555
       it is recommended to set a breakpoint on the following instruction.
556
    */
557
  }
558
#endif /*STM8S208 or STM8S207*/
559
560
#if defined(STM8S207) || defined(STM8S208)
561
/**
562
  * @brief ADC2 interrupt routine.
563
  * @par Parameters:
564
  * None
565
  * @retval
566
  * None
567
*/
568
#ifdef _COSMIC_
569
@far @interrupt void ADC2_IRQHandler(void)
570
#else /* _RAISONANCE_ */
571
void ADC2_IRQHandler(void) interrupt 22
572
#endif /* _COSMIC_ */
573
{
574
575
    /* In order to detect unexpected events during development,
576
       it is recommended to set a breakpoint on the following instruction.
577
    */
578
    return;
579
580
}
581
#else /*STM8S105, STM8S103 or STM8S903*/
582
/**
583
  * @brief ADC1 interrupt routine.
584
  * @par Parameters:
585
  * None
586
  * @retval
587
  * None
588
*/
589
#ifdef _COSMIC_
590
@far @interrupt void ADC1_IRQHandler(void)
591
#else /* _RAISONANCE_ */
592
void ADC1_IRQHandler(void) interrupt 22
593
#endif /* _COSMIC_ */
594
{
595
596
    /* In order to detect unexpected events during development,
597
       it is recommended to set a breakpoint on the following instruction.
598
    */
599
    return;
600
601
}
602
#endif /*STM8S208 or STM8S207*/
603
604
#ifdef STM8S903
605
/**
606
  * @brief Timer6 Update/Overflow/Trigger Interruption routine.
607
  * @par Parameters:
608
  * None
609
  * @retval
610
  * None
611
*/
612
#ifdef _COSMIC_
613
@far @interrupt void TIM6_UPD_OVF_TRG_IRQHandler(void)
614
#else /* _RAISONANCE_ */
615
void TIM6_UPD_OVF_TRG_IRQHandler(void) interrupt 23
616
#endif /* _COSMIC_ */
617
{
618
  /* In order to detect unexpected events during development,
619
     it is recommended to set a breakpoint on the following instruction.
620
  */
621
}
622
#else /*STM8S208, STM8S207, STM8S105 or STM8S103*/
623
/**
624
  * @brief Timer4 Update/Overflow Interruption routine.
625
  * @par Parameters:
626
  * None
627
  * @retval
628
  * None
629
*/
630
#ifdef _COSMIC_
631
@far @interrupt void TIM4_UPD_OVF_IRQHandler(void)
632
#else /* _RAISONANCE_ */
633
void TIM4_UPD_OVF_IRQHandler(void) interrupt 23
634
#endif /* _COSMIC_ */
635
{
636
  /* In order to detect unexpected events during development,
637
     it is recommended to set a breakpoint on the following instruction.
638
  */
639
}
640
#endif /*STM8S903*/
641
642
/**
643
  * @brief Eeprom EEC Interruption routine.
644
  * @par Parameters:
645
  * None
646
  * @retval
647
  * None
648
*/
649
#ifdef _COSMIC_
650
@far @interrupt void EEPROM_EEC_IRQHandler(void)
651
#else /* _RAISONANCE_ */
652
void EEPROM_EEC_IRQHandler(void) interrupt 24
653
#endif /* _COSMIC_ */
654
{
655
  /* In order to detect unexpected events during development,
656
     it is recommended to set a breakpoint on the following instruction.
657
  */
658
}

von Michael K. (Gast)


Lesenswert?

Oh das wird wieder mecker geben derart den code zu posten ...

Wie der Name schon sagt, ein IRQ der nicht abgehandelt wird ...
Welchen Teil des folgenden Satzes hattest Du denn nicht verstanden ?

>/* In order to detect unexpected events during development,
>     it is recommended to set a breakpoint on the following instruction.
>  */

Wenn Du auf jeden IRQ einen Breakpoint setzt hast Du das Problem sehr 
schnell gefunden.

Ich setze in diese Codewurst von ST auch nur Funktionsaufrufe statt 
meinen eigenen Code da auch noch reinzudrücken.

Kleiner Tip:
Die ST Lib macht im Hintergrund vieles was Du nicht erwartest und vieles 
nicht was Du erwartst.
Wahrscheinlich ist der TX empty IRQ aktiviert worden.
Schau in den ST Code.

von µC8051 (Gast)


Lesenswert?

Hallo,

Danke für deine Antwort. Ich habe bereits an jede IRQ einen Breakpoint 
gesetzt und eben heraus gefunden, dass der direkt in den 
NonHandledInterrupt Interrupt springt.
Den TX empty interrupt habe ich jetzt noch extra diasabled aber auch das 
bringt nichts.

Also mir ist vom Namen NonHandledInterrupt nicht so klar was der jetzt 
macht. Klär mich bitte auf.

von µC8051 (Gast)


Lesenswert?

Also wenn ich die Zeile "UART2_ITConfig(UART2_IT_RXNE_OR, ENABLE);" raus 
mache und damit den RX-Interrupt läuft das Programm durch. Also geh ich 
mal davon aus das er die entsprechende Routine nicht findet und daher in 
den NonHandledInterrupt springt. Aber warum?

von Little B. (lil-b)


Lesenswert?

Gib doch mal bitte zwei informationen (beziehungsweise eine info...)

1.
Was steht an Adresse 0x00 805C
(das sollte eigentlich die Adresse von UART2RX Interrupt sein)

2.
Schau mal im Mapfile, welche Adresse deine ISR tatsächlich hat.

3. (optional)
Schau doch zum spass auch mal, welche adresse NonHandledInterrupt hat

Wohin zeigt 0x00 805C ?
Macht evtl der Linker einen Fehler?

von Michael K. (Gast)


Lesenswert?

µC8051 schrieb:
> Klär mich bitte auf.

Non Handled - Nicht gehandhabt
Wenn Du Dir 'Interrupt vector mapping' auf S36 anschaust wirst Du sehen 
das es keinen IRQ 25 'NonHandledIRQ' gibt.
Die Einsprungadresse dafür kommt vom Compiler, weil da sonst nichts drin 
stehen würde.
Damit fängt der IRQs ab bei denen er nicht weiß was er damit tun soll.
Lustigerweise wird das wohl nur beim COSMIC gemacht, weswegen ich davon 
ausgehe das Du den benutzt.
Keine Ahnung was beim IAR drinstehen würde, da ich die immer direkt 
abfange (breakpoints) was auch immer funktioniert.

Ich vermute also das Dein Compiler Deine IRQ Anweisung nicht versteht.
Schau Dir an was letzendlich in der IRQ Vector Table steht und ob Deine 
RX IRQ Routine überhaupt dabei ist.

Ich bin weder mit Cosmic noch Raisonance warm geworden und sehr 
zufrieden mit den IAR der bis 8K kostenlos ist.

von µC8051 (Gast)


Lesenswert?

Danke für die Hilfe. Ich hab mir den Interrupt Vector Tabelle aneschaut.

Da stand die Interruptroutine für die UART falsch drin.

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.