Other Parts Discussed in Thread: HALCOGEN
I spent time trying to figure out why, unless I set the task's Privilege bit, my HET's PWM will not work. Using all 'stock' code as generated by HalCoGen for LS043xx with FreeRTOS, and just putting 'driver' / hal init into a task.
The odd things are : I can do init calls like - adcInit(), hetInit() - without settings the tasks MPU privilege bit , and , these peripherals do appear to be initialized. By initialized I mean : ADC sampling works , e.g. with RTI 0 trigger, and I get ADC interrupts on correct time & values match input voltages. Het gets initilized, it _seems_, at least say HET output pin(s) get to default output set at init (e.g. set DOUT 1) as I see externally.
BUT, when it comes to PWM from HET, then this does NOT start, unless hetInit() was called from privileged task OR from main before scheduler starts. So whether you enabled PWM to start by default in HalCoGen in HET init, or if you call pwmStart() .. later, this does not work, PWM won't start. Also, trying to trigger same ADC which works with RTI trigger but from HET pinX won't trigger either. In other words, my ADC with group triggering from RTI works, but group for e.g. triggering from HET1_8 doesnt as nothing coming in from that HET.
Also odd, is that it all 'silently' fails, there is no reason or crash or abort anywhere, as I would _think_ I should get if MPU is working and I'm trying to init a privileged section. But nothing of the sort.
So I conceptually don't understand it : why is this like this, hetInit() silently will prevent PWM from working later, _unless_ it was invoked from a privileged task. (i.e, the privilege bit on priority).
I would expect MPU (if configured accordingly..) to trigger abort as soon as I touch HET registers if un-privileged when initializing, or when trying to start pwm as that accesses HET RAM registers. But nothing of the sort, all silently seems calle d& returned, yet PWM will not work ..
Any light on this ? Do all HalCoGen's auto gen drivers/hal sort of silent when invoked from un-privileged task? And why (reason) I have such HET isssue ..