>I've already done that - It didn't work. This is called from UserMain at startup:
Make it simpler. Write a totally new app, then start small and build on it.
- UserMain only with a global packet declaration, function to setup packet parameters, function to send and halt. Note that you probably need to add a delay before the halt to give the packet time to go out.
- Now modify to use multiple tasks and a semaphore. Trigger the semaphore with something like stdin getchar() in the posting task.
- Now add interrupts
Code: Select all
IRQ7packet.Send(ipaddr);
asm("HALT");
>which never gets called.
How do you know? Just because you don's see the packet doesn't mean it isn't getting called. Toggle a gpio or led to verify.
>I'm assuming that this is because the scheduler allows the current interrupted task to finish running before it addresses the IRQ7 semaphore?
Absolutely not, unless the current interrupted task is a higher priority
>Unless MAIN_PRIO -10 is insufficient? Is there a way to kill all tasks before returning from the interrupt routine?
Then the system will not be able to do anything
>Or some way to get the scheduler to immediately switch to this task of sending?
If your priorities are set correctly, that is exactly what will happen as far as user created tasks go. Not sure what other higher priority tasks will get called to actually send the packet. They are listed in constants.h. At a minimum it looks like these two need to run in order to send your packet:
#define IP_PRIO (39)
#define ETHER_SEND_PRIO (38)
>Maybe encasing the "Send" function with "USER_ENTER_CRITICAL" could prevent other interrupts or tasks from switching?
If the tasks that are necessary for the network stack to operate cannot run, your packet will never go out. This isn't like sending something out a serial port. A lot of stuff needs to occur to get the packet out.